/* bahn dashboard — glass theme */

:root {
    --bahn-indigo: #6366f1;
    --bahn-teal: #00d4aa;
    --bahn-green: #4caf50;
    --bahn-orange: #ffb74d;
    --bahn-red: #ef5350;
    --bahn-bg: #11131a;
    --bahn-surface: #1a1d2e;
    --bahn-border: #2a2d3e;
    --bahn-dim: #6b7280;
}

body {
    background: var(--bahn-bg);
}

.dim {
    color: var(--bahn-dim);
}

/* Glass grid — 3 columns on desktop, stack on mobile */
.glass-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .glass-grid {
        grid-template-columns: 1fr;
    }
}

/* Sections */
.glass-section {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.glass-section h3 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bahn-dim);
}

/* Status card */
.glass-status-card {
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--bahn-dim);
}

.glass-status-card.running {
    border-left-color: var(--bahn-teal);
    background: rgba(0, 212, 170, 0.05);
}

.glass-status-card.completed {
    border-left-color: var(--bahn-green);
    background: rgba(76, 175, 80, 0.05);
}

.glass-status-card.failed {
    border-left-color: var(--bahn-red);
    background: rgba(239, 83, 80, 0.05);
}

.glass-status-card.idle {
    border-left-color: var(--bahn-dim);
}

/* Pulse animation for running status */
.glass-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bahn-teal);
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Cost stats */
.glass-costs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.glass-stat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 80px;
}

.glass-stat .label {
    font-size: 0.75rem;
    color: var(--bahn-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.glass-stat .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bahn-teal);
}

/* Feed / list containers */
.glass-feed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Agent cards */
.glass-agent-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bahn-border);
    border-radius: 6px;
    padding: 0.75rem;
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.agent-header .tokens {
    font-size: 0.75rem;
    color: var(--bahn-dim);
    font-family: monospace;
}

.agent-output {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-bottom: 0.25rem;
}

.agent-meta {
    font-size: 0.7rem;
    color: var(--bahn-dim);
}

/* Client cards */
.glass-client-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bahn-border);
    border-radius: 6px;
    padding: 0.75rem;
}

.client-meta {
    font-size: 0.75rem;
    color: var(--bahn-dim);
    margin-top: 0.25rem;
}

.client-id {
    font-family: monospace;
    color: var(--bahn-indigo);
}

/* Table */
.glass-table {
    width: 100%;
    border-collapse: collapse;
}

.glass-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bahn-dim);
    border-bottom: 1px solid var(--bahn-border);
    padding: 0.5rem;
    text-align: left;
}

.glass-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(42, 45, 62, 0.5);
    font-size: 0.85rem;
}

.glass-table code {
    font-size: 0.8rem;
    color: var(--bahn-indigo);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.completed {
    background: rgba(76, 175, 80, 0.15);
    color: var(--bahn-green);
}

.badge.failed {
    background: rgba(239, 83, 80, 0.15);
    color: var(--bahn-red);
}

.badge.running {
    background: rgba(0, 212, 170, 0.15);
    color: var(--bahn-teal);
}

.badge.draft {
    background: rgba(107, 114, 128, 0.15);
    color: var(--bahn-dim);
}

/* Auth pages — see bottom of file for full auth styling */

/* Organization grid */
.orgs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.org-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.org-card-link {
    text-decoration: none;
    color: inherit;
}

.org-card {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.org-card:hover {
    border-color: var(--bahn-indigo);
}

.org-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.org-card-desc {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.org-card-meta {
    font-size: 0.75rem;
    color: var(--bahn-dim);
}

/* Org detail */
.org-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.org-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.org-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.org-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.4rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-start {
    background: var(--bahn-teal);
    color: #11131a;
}

.btn-pause {
    background: var(--bahn-orange);
    color: #11131a;
}

.btn-run {
    background: var(--bahn-indigo);
    color: #fff;
}

/* Config preview */
.config-preview {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--bahn-border);
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.75rem;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Monospace textarea (for JSON / prompts) */
.mono-textarea {
    font-family: monospace;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--bahn-border);
}

/* Create form */
.org-create-form textarea {
    resize: vertical;
}

/* Run errors */
.run-errors {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--bahn-red);
}

/* Billing */
.billing-plan {
    margin-bottom: 1rem;
}

.billing-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.billing-meters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.billing-meter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.billing-meter-label {
    width: 60px;
    font-size: 0.75rem;
    color: var(--bahn-dim);
    text-transform: uppercase;
}

.billing-meter-bar {
    flex: 1;
    height: 8px;
    background: var(--bahn-border);
    border-radius: 4px;
    overflow: hidden;
}

.billing-meter-fill {
    height: 100%;
    background: var(--bahn-teal);
    border-radius: 4px;
    transition: width 0.3s;
}

.billing-meter-value {
    width: 150px;
    text-align: right;
    font-size: 0.8rem;
    color: #d1d5db;
    font-family: monospace;
}

/* Plans grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.plan-card {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.plan-card.plan-current {
    border-color: var(--bahn-teal);
}

.plan-card h4 {
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bahn-teal);
    margin-bottom: 0.75rem;
}

.plan-features {
    font-size: 0.8rem;
    color: #d1d5db;
    line-height: 1.8;
}

/* Template marketplace */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.template-card {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.template-card-desc {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.template-card-meta {
    font-size: 0.75rem;
    color: var(--bahn-dim);
    margin-bottom: 0.5rem;
}

.template-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.template-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--bahn-indigo);
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}

.template-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-filters .btn-action {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    background: var(--bahn-surface);
    color: #d1d5db;
    border: 1px solid var(--bahn-border);
}

.template-filters .btn-action.btn-start {
    background: var(--bahn-teal);
    color: #11131a;
    border-color: var(--bahn-teal);
}

/* Connector directory */
.connector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.connector-card {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.connector-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.connector-card-desc {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.connector-card-meta {
    font-size: 0.75rem;
    color: var(--bahn-dim);
    margin-bottom: 0.25rem;
}

.connector-card-id {
    font-size: 0.75rem;
}

/* ------------------------------------------------------------------ */
/* Toast notifications                                                */
/* ------------------------------------------------------------------ */
#bahn-toasts {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.bahn-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 380px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bahn-toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.bahn-toast-success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--bahn-green);
    border-left: 3px solid var(--bahn-green);
}

.bahn-toast-error {
    background: rgba(239, 83, 80, 0.2);
    color: var(--bahn-red);
    border-left: 3px solid var(--bahn-red);
}

.bahn-toast-info {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-left: 3px solid var(--bahn-indigo);
}

.bahn-toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    margin-left: auto;
    line-height: 1;
}

.bahn-toast-close:hover {
    opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Error pages                                                        */
/* ------------------------------------------------------------------ */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--bahn-indigo);
    line-height: 1;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.error-page h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* ------------------------------------------------------------------ */
/* Glassmorphism enhancement                                          */
/* ------------------------------------------------------------------ */
@supports (backdrop-filter: blur(12px)) {
    .glass-section {
        backdrop-filter: blur(12px);
        background: rgba(26, 29, 46, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

/* ------------------------------------------------------------------ */
/* Button transitions & micro-interactions                            */
/* ------------------------------------------------------------------ */
.btn-action {
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-action:active {
    transform: translateY(0);
}

/* ------------------------------------------------------------------ */
/* Skip navigation (accessibility)                                    */
/* ------------------------------------------------------------------ */
.skip-nav {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: var(--bahn-indigo);
    color: #fff;
    text-decoration: none;
    border-radius: 0 0 6px 0;
}

.skip-nav:focus {
    left: 0;
}

/* ------------------------------------------------------------------ */
/* Nav brand                                                          */
/* ------------------------------------------------------------------ */
.nav-brand {
    text-decoration: none;
    color: inherit;
}

/* Footer */
footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bahn-border);
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Landing page                                                        */
/* ------------------------------------------------------------------ */
.landing-body {
    background: var(--bahn-bg);
    min-height: 100vh;
}

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(17, 19, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bahn-border);
    padding: 0.75rem 0;
}

.landing-nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.landing-nav-links a {
    font-size: 0.9rem;
}

/* Hero */
.landing-hero {
    text-align: center;
    padding: 6rem 1rem 4rem;
}

.landing-headline {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--bahn-teal), var(--bahn-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subhead {
    font-size: 1.15rem;
    color: #9ca3af;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.landing-cta-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Live demo */
.landing-demo {
    padding: 3rem 1rem;
    text-align: center;
}

.demo-form {
    max-width: 600px;
    margin: 1.5rem auto;
    text-align: left;
}

.demo-form textarea {
    width: 100%;
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    color: #d1d5db;
    padding: 0.75rem;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.demo-form textarea:focus {
    border-color: var(--bahn-indigo);
    outline: none;
}

.demo-output {
    max-width: 600px;
    margin: 1.5rem auto;
    text-align: left;
}

.demo-result {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.demo-prompt-echo {
    font-style: italic;
    color: var(--bahn-dim);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.demo-dag-container {
    margin: 1rem 0;
    text-align: center;
}

.demo-dag {
    max-width: 100%;
    height: auto;
}

.demo-agents {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.demo-agent {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bahn-border);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
}

.demo-agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.demo-agent-desc {
    font-size: 0.8rem;
    color: #9ca3af;
}

.demo-cta {
    text-align: center;
    margin-top: 1.25rem;
}

/* How it works */
.landing-steps {
    padding: 3rem 1rem;
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto 0;
    text-align: left;
}

.step-card {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bahn-indigo);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.step-card h3 {
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.5;
}

/* Use cases */
.landing-usecases {
    padding: 3rem 1rem;
    text-align: center;
}

.usecases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 800px;
    margin: 2rem auto 0;
    text-align: left;
}

.usecase-card {
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.usecase-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.usecase-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.usecase-card p {
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.5;
}

/* Pricing (landing) */
.landing-pricing {
    padding: 3rem 1rem;
    text-align: center;
}

/* Final CTA */
.landing-final-cta {
    padding: 4rem 1rem;
    text-align: center;
}

/* Landing mobile */
@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
    .usecases-grid {
        grid-template-columns: 1fr;
    }
    .landing-hero {
        padding: 3rem 1rem 2rem;
    }
}

/* ------------------------------------------------------------------ */
/* Auth pages (login + signup)                                         */
/* ------------------------------------------------------------------ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-brand {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--bahn-teal), var(--bahn-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card h2 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid rgba(239, 83, 80, 0.25);
    color: var(--bahn-red);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bahn-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Username availability indicator */
.input-with-status {
    position: relative;
}

.input-status {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 500;
}

.input-status-available {
    color: var(--bahn-green);
}

.input-status-taken {
    color: var(--bahn-red);
}

.input-status-warn {
    color: var(--bahn-orange);
}

/* Password strength meter */
.password-meter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.password-meter-row meter {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bahn-border);
    border: none;
}

.password-meter-row meter::-webkit-meter-bar {
    background: var(--bahn-border);
    border-radius: 3px;
    border: none;
}

.password-meter-row meter::-webkit-meter-optimum-value {
    background: var(--bahn-green);
    border-radius: 3px;
}

.password-meter-row meter::-webkit-meter-suboptimum-value {
    background: var(--bahn-orange);
    border-radius: 3px;
}

.password-meter-row meter::-webkit-meter-even-less-good-value {
    background: var(--bahn-red);
    border-radius: 3px;
}

.password-meter-row meter::-moz-meter-bar {
    border-radius: 3px;
}

.password-strength-none { color: var(--bahn-dim); font-size: 0.75rem; }
.password-strength-weak { color: var(--bahn-red); font-size: 0.75rem; }
.password-strength-fair { color: var(--bahn-orange); font-size: 0.75rem; }
.password-strength-good { color: var(--bahn-teal); font-size: 0.75rem; }
.password-strength-strong { color: var(--bahn-green); font-size: 0.75rem; }

/* Skeleton loading placeholder */
.skeleton-bar {
    background: linear-gradient(90deg, var(--bahn-surface) 25%, rgba(255,255,255,0.04) 50%, var(--bahn-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ------------------------------------------------------------------ */
/* Onboarding wizard                                                   */
/* ------------------------------------------------------------------ */
.onboarding-body {
    background: var(--bahn-bg);
}

.wizard-container {
    max-width: 560px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.wizard-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.wizard-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--bahn-teal), var(--bahn-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

/* Step progress dots */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
}

.wizard-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bahn-surface);
    border: 2px solid var(--bahn-border);
    color: var(--bahn-dim);
    transition: all 0.3s ease;
}

.wizard-step-dot.active {
    background: var(--bahn-indigo);
    border-color: var(--bahn-indigo);
    color: #fff;
}

.wizard-step-dot.done {
    background: var(--bahn-teal);
    border-color: var(--bahn-teal);
    color: #11131a;
}

.wizard-step-line {
    width: 40px;
    height: 2px;
    background: var(--bahn-border);
}

/* Wizard content area */
.wizard-content {
    padding: 1.5rem;
}

.wizard-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Example prompt chips */
.wizard-examples {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.wizard-example {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    cursor: pointer;
    transition: all 0.2s;
}

.wizard-example:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--bahn-indigo);
}

/* Loading indicator */
.wizard-loading {
    text-align: center;
    padding: 1rem;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}

/* ------------------------------------------------------------------ */
/* DAG visualization                                                   */
/* ------------------------------------------------------------------ */
.dag-container {
    overflow-x: auto;
    padding: 0.5rem 0;
}

.dag-svg {
    width: 100%;
    height: auto;
    max-height: 500px;
}

.dag-node {
    cursor: pointer;
    transition: opacity 0.2s;
}

.dag-node rect {
    transition: stroke-width 0.2s, filter 0.2s;
}

.dag-node:hover rect {
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px currentColor);
}

.dag-edge {
    transition: opacity 0.2s, stroke 0.2s;
}

/* Dim non-hovered nodes when one is active */
.dag-svg.dag-highlight .dag-node {
    opacity: 0.25;
}

.dag-svg.dag-highlight .dag-node.dag-active {
    opacity: 1;
}

.dag-svg.dag-highlight .dag-edge {
    opacity: 0.15;
}

.dag-svg.dag-highlight .dag-edge.dag-active {
    opacity: 1;
    stroke: var(--bahn-teal);
}

/* Pulse on running nodes */
.dag-node-running rect {
    animation: dag-pulse 2s infinite;
}

@keyframes dag-pulse {
    0%, 100% { stroke-opacity: 1; }
    50% { stroke-opacity: 0.4; }
}

/* ------------------------------------------------------------------ */
/* Nav redesign                                                        */
/* ------------------------------------------------------------------ */
.nav-center {
    display: flex;
    gap: 0;
    justify-content: center;
}

.nav-right {
    display: flex;
    gap: 0;
    align-items: center;
}

.nav-search-trigger {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--bahn-border);
    border-radius: 6px;
    color: var(--bahn-dim);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.nav-search-trigger:hover {
    border-color: var(--bahn-indigo);
    color: #d1d5db;
}

.nav-search-trigger kbd {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--bahn-border);
    font-family: system-ui;
}

.nav-search-icon {
    font-size: 1rem;
}

/* ------------------------------------------------------------------ */
/* Command Palette                                                     */
/* ------------------------------------------------------------------ */
.cp-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    padding-top: 15vh;
}

.cp-overlay.cp-open {
    display: flex;
}

.cp-dialog {
    width: 100%;
    max-width: 520px;
    background: var(--bahn-surface);
    border: 1px solid var(--bahn-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.cp-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--bahn-border);
    color: #e5e7eb;
    font-size: 1rem;
    outline: none;
}

.cp-input::placeholder {
    color: var(--bahn-dim);
}

.cp-results {
    overflow-y: auto;
    max-height: 300px;
}

.cp-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(42, 45, 62, 0.4);
    transition: background 0.15s;
}

.cp-item:hover,
.cp-item.cp-selected {
    background: rgba(99, 102, 241, 0.1);
    color: #fff;
}

.cp-icon {
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
    opacity: 0.6;
}

.cp-meta {
    font-size: 0.75rem;
    color: var(--bahn-dim);
    margin-left: 0.5rem;
}

.cp-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--bahn-dim);
    font-size: 0.9rem;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.8rem;
    color: var(--bahn-dim);
    padding: 0.5rem 0;
}

.breadcrumbs a {
    color: var(--bahn-dim);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #d1d5db;
}

.breadcrumbs .separator {
    margin: 0 0.4rem;
    opacity: 0.5;
}

/* ------------------------------------------------------------------ */
/* Empty states                                                        */
/* ------------------------------------------------------------------ */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.empty-state-icon {
    font-size: 2rem;
    opacity: 0.4;
    margin-bottom: 0.75rem;
}

.empty-state h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--bahn-dim);
    margin-bottom: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state a {
    color: var(--bahn-indigo);
}

/* ------------------------------------------------------------------ */
/* Skeleton loading shapes                                             */
/* ------------------------------------------------------------------ */
.skeleton-card {
    background: linear-gradient(
        90deg,
        var(--bahn-surface) 25%,
        rgba(255, 255, 255, 0.04) 50%,
        var(--bahn-surface) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 8px;
    border: 1px solid var(--bahn-border);
    height: 100px;
}

.skeleton-row {
    background: linear-gradient(
        90deg,
        var(--bahn-surface) 25%,
        rgba(255, 255, 255, 0.04) 50%,
        var(--bahn-surface) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
    height: 20px;
    margin-bottom: 0.5rem;
}

.skeleton-stat {
    background: linear-gradient(
        90deg,
        var(--bahn-surface) 25%,
        rgba(255, 255, 255, 0.04) 50%,
        var(--bahn-surface) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
    width: 80px;
    height: 40px;
    display: inline-block;
}

/* ------------------------------------------------------------------ */
/* Terminal / live output                                               */
/* ------------------------------------------------------------------ */
.terminal-output {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--bahn-border);
    border-radius: 6px;
    padding: 0.75rem;
    font-family: monospace;
    font-size: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
}

.terminal-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(42, 45, 62, 0.5);
}

.terminal-line {
    margin-bottom: 0.15rem;
}

.terminal-output-text {
    color: #9ca3af;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    word-break: break-word;
}

/* ================================================================== */
/* Phase 8: Final polish                                               */
/* ================================================================== */

/* ------------------------------------------------------------------ */
/* Glassmorphism on all card types                                     */
/* ------------------------------------------------------------------ */
@supports (backdrop-filter: blur(12px)) {
    .org-card,
    .plan-card,
    .template-card,
    .connector-card,
    .step-card,
    .usecase-card {
        backdrop-filter: blur(12px);
        background: rgba(26, 29, 46, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

/* ------------------------------------------------------------------ */
/* Card hover micro-interactions                                       */
/* ------------------------------------------------------------------ */
.org-card {
    transition: transform 0.2s ease, border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.org-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.template-card,
.connector-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.template-card:hover,
.connector-card:hover {
    border-color: var(--bahn-indigo);
    transform: translateY(-1px);
}

.glass-section {
    transition: border-color 0.2s ease;
}

.glass-section:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* ------------------------------------------------------------------ */
/* HTMX loading indicator on trigger element                           */
/* ------------------------------------------------------------------ */
.htmx-request {
    opacity: 0.7;
    transition: opacity 0.2s;
}

/* ------------------------------------------------------------------ */
/* Accessibility                                                       */
/* ------------------------------------------------------------------ */
:root {
    --bahn-dim: #8b92a0;  /* Brightened for WCAG AA contrast */
}

/* Inline field errors */
.field-error {
    color: var(--bahn-red);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Focus-visible outlines */
:focus-visible {
    outline: 2px solid var(--bahn-indigo);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--bahn-indigo);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Mobile responsive                                                   */
/* ------------------------------------------------------------------ */

/* Small phones */
@media (max-width: 480px) {
    .btn-action {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-lg {
        width: 100%;
        text-align: center;
    }

    .landing-cta-row {
        flex-direction: column;
        align-items: center;
    }

    .auth-card {
        padding: 1.25rem;
    }

    .wizard-container {
        padding: 0 0.5rem;
    }

    .wizard-step-line {
        width: 20px;
    }

    .cp-dialog {
        margin: 0 0.5rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .glass-grid {
        grid-template-columns: 1fr;
    }

    .org-grid {
        grid-template-columns: 1fr;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }

    .connector-grid {
        grid-template-columns: 1fr;
    }

    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .org-detail-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-center {
        display: none;
    }

    .breadcrumbs {
        display: none;
    }

    .dag-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .glass-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Small laptops */
@media (max-width: 1024px) {
    .usecases-grid {
        grid-template-columns: 1fr;
    }

    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
