/*
MockFlow-AI Styles
Cream/Off-white theme with soft accent colors
Mature, minimal, breathable design
*/

/* ==================== RESET & BASE ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cream/Off-white palette */
    --bg-cream: #FAF8F5;
    --bg-warm: #F5F2ED;
    --bg-soft: #EFEBE5;
    --bg-card: #FFFFFF;

    /* Accent colors - soft pastels */
    --accent-green: #C8E6C9;
    --accent-green-deep: #81C784;
    --accent-pink: #F8BBD9;
    --accent-pink-deep: #F06292;
    --accent-purple: #E1BEE7;
    --accent-purple-deep: #BA68C8;
    --accent-cyan: #4AEADC;
    --accent-cyan-glow: rgba(74, 234, 220, 0.6);

    /* Text */
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #7A7A7A;
    --text-light: #9A9A9A;

    /* Functional colors */
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #E53935;
    --info: #2196F3;

    /* Agent soul colors */
    --soul-core: #E8F5E9;
    --soul-glow: rgba(129, 199, 132, 0.4);
    --soul-wave: #81C784;

    /* Candidate colors */
    --candidate-bg: #1A1A1A;
    --candidate-wave: #4AEADC;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-soft: 0 2px 20px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 30px rgba(0, 0, 0, 0.08);
    --shadow-lifted: 0 8px 40px rgba(0, 0, 0, 0.12);

    /* Theme-aware compound colors (overridden in dark) */
    --overlay-scrim: rgba(0, 0, 0, 0.4);
    --overlay-scrim-strong: rgba(0, 0, 0, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.70);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    --input-bg: rgba(255, 255, 255, 0.5);
    --input-bg-focus: #FFFFFF;
    --dropdown-bg: #FFFFFF;
    --hairline: rgba(26, 26, 26, 0.1);
    --hairline-strong: rgba(26, 26, 26, 0.2);
    --brutal-shadow: rgba(0, 0, 0, 0.2);
    --msg-error-bg: #FFEBEE;
    --msg-success-bg: #E8F5E9;
    --on-accent: #FFFFFF;

    /* Button / control surfaces — text colors guaranteed AA in both themes.
     * --solid-* = a high-contrast "filled" control (dark slab in light mode,
     * light slab in dark mode). --on-solid = the text/icon color that sits on it.
     * Other pages keep using --text-* and --bg-*; these are additive. */
    --solid-surface: #1A1A1A;        /* the dark CTA slab in light mode */
    --solid-surface-hover: #000000;
    --on-solid: #FFFFFF;             /* text on the solid slab (AA on #1A1A1A) */
    --on-solid-muted: rgba(255, 255, 255, 0.72);
    --control-surface: var(--bg-card);
    --control-border: var(--hairline-strong);
    --on-control: var(--text-primary);
    --focus-ring: var(--accent-green-deep);
    --feature-cyan: #B2EBF2;
}


html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==================== TYPOGRAPHY ==================== */

h1,
h2,
h3,
h4 {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ==================== LANDING PAGE ==================== */

.hero {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(1.25rem, 4vw, var(--spacing-2xl));
    background:
        radial-gradient(1100px 720px at 88% -8%, color-mix(in srgb, var(--accent-green) 55%, transparent) 0%, transparent 60%),
        radial-gradient(900px 620px at -6% 112%, color-mix(in srgb, var(--accent-purple) 48%, transparent) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-warm) 100%);
    position: relative;
    overflow: hidden;
}

/* Soft animated aura behind the content */
.hero::before {
    content: '';
    position: absolute;
    top: -22%;
    right: -14%;
    width: 46vw;
    height: 46vw;
    max-width: 620px;
    max-height: 620px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 68%);
    opacity: 0.14;
    border-radius: 50%;
    pointer-events: none;
    animation: hero-float 16s ease-in-out infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -18%;
    left: -12%;
    width: 40vw;
    height: 40vw;
    max-width: 520px;
    max-height: 520px;
    background: radial-gradient(circle, var(--accent-pink) 0%, transparent 70%);
    opacity: 0.16;
    border-radius: 50%;
    pointer-events: none;
    animation: hero-float 19s ease-in-out infinite alternate-reverse;
}

@keyframes hero-float {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(2.5%, -3%, 0) scale(1.08); }
}

.hero-content {
    max-width: 1080px;
    width: 100%;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}

.hero-lead {
    grid-column: 1;
    min-width: 0;
}

/* Eyebrow pill */
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    margin-bottom: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-soft);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent);
    animation: eyebrow-pulse 2.4s ease-in-out infinite;
}

@keyframes eyebrow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); }
    50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 0%, transparent); }
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}

.logo-mark:hover {
    transform: translateY(-2px) rotate(-3deg);
    box-shadow: var(--shadow-lifted);
}

.logo-mark svg {
    width: 54px;
    height: 54px;
}

h1 {
    font-size: clamp(2.6rem, 6vw, 4rem);
    line-height: 1.02;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wordmark-dot {
    -webkit-text-fill-color: var(--accent-green-deep);
    color: var(--accent-green-deep);
}

.tagline {
    font-size: clamp(1.02rem, 1.6vw, 1.22rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-weight: 400;
    max-width: 33ch;
}

/* ---- Hero CTA cluster (sits under the orb, on the right) ---- */
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-xs) 0 0;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.5, 1),
        box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease,
        border-color 0.25s ease;
    will-change: transform;
}

.btn-cta-icon {
    display: inline-flex;
}

.btn-cta-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.btn-cta-arrow {
    display: inline-flex;
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.5, 1);
}

.btn-cta-arrow svg {
    width: 1.05rem;
    height: 1.05rem;
}

/* Primary CTA — the unmistakable "Start Interview" */
.btn-cta.primary {
    background: var(--solid-surface);
    color: var(--on-solid);
    box-shadow: var(--shadow-medium), 0 0 0 0 color-mix(in srgb, var(--accent-green-deep) 60%, transparent);
}

.btn-cta.primary .btn-cta-icon svg,
.btn-cta.primary .btn-cta-arrow svg {
    color: var(--on-solid);
    stroke: currentColor;
}

.btn-cta.primary:hover {
    background: var(--solid-surface-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lifted),
        0 0 0 6px color-mix(in srgb, var(--accent-green-deep) 22%, transparent);
}

.btn-cta.primary:hover .btn-cta-arrow {
    transform: translateX(4px);
}

.btn-cta.primary:active {
    transform: translateY(-1px);
}

/* Ghost / secondary CTA — clearly subordinate but legible in both themes */
.btn-cta.ghost {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--control-border);
    box-shadow: var(--shadow-soft);
}

.btn-cta.ghost .btn-cta-icon svg {
    color: var(--accent-green-deep);
    stroke: currentColor;
}

.btn-cta.ghost:hover {
    transform: translateY(-3px);
    border-color: var(--accent-green-deep);
    box-shadow: var(--shadow-medium);
}

/* ---- Feature cards (the 4 capabilities) ---- */
.features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin: 0 0 var(--spacing-lg);
    min-width: 0;
}

.features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.5, 1),
        box-shadow 0.25s ease, border-color 0.25s ease;
}

.features li:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--hairline-strong);
}

.feature-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.feature-icon svg {
    width: 18px;
    height: 18px;
}

.feature-icon.green  { background: var(--accent-green); }
.feature-icon.pink   { background: var(--accent-pink); }
.feature-icon.purple { background: var(--accent-purple); }
.feature-icon.cyan   { background: var(--feature-cyan); }

.feature-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.feature-body strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.feature-body em {
    font-style: normal;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ---- Powered-by row ---- */
.tech-stack {
    margin-top: 0;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--hairline);
}

.tech-label {
    font-size: 0.6875rem;
    color: var(--text-light);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.tech-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: var(--bg-soft);
    color: var(--text-secondary);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease,
        border-color 0.2s ease, transform 0.2s ease;
}

a.badge:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--hairline-strong);
    transform: translateY(-1px);
}

/* ==================== HERO LIVING-ORB STAGE ====================
 * The right column of the hero: the brand's signature living orb as the
 * centerpiece, with concentric bloom rings rippling behind it and a small
 * "ready" caption below. Uses the .mf-* kit from animations.css. */
.hero-orb-stage {
    grid-column: 2;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    min-width: 0;
    align-self: center;
}

/* The orb: a ring of sun-rays with eyes at the centre (the user's preferred
   .mf-rays + .mf-eyes motif). Scales fluidly with the viewport. */
.hero-orb {
    position: relative;
    width: clamp(210px, 27vw, 330px);
    height: clamp(210px, 27vw, 330px);
    display: grid;
    place-items: center;
    z-index: 1;
}
.hero-orb .mf-rays {
    --mf-rays-size: clamp(210px, 27vw, 330px);
    --mf-ray-count: 56;
}
.hero-orb-eyes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    --mf-eye-size: clamp(11px, 1.5vw, 16px);
    z-index: 2;
}
/* "Speaking" — rays reach higher + sweep faster (mirrors the live visualizer). */
.hero-orb.is-speaking .mf-rays { --mf-ray-peak: calc(var(--mf-rays-size) * 0.21); }
.hero-orb.is-speaking .mf-rays > span {
    animation-duration: calc(1.5s / var(--mf-speed));
    animation-delay: calc((var(--i) / var(--mf-ray-count)) * -1.5s / var(--mf-speed));
}

/* Bloom rings centered on the orb, sized a touch larger so they ripple past it.
 * Behind the orb (z-index 0) and non-interactive. */
.hero-orb-bloom {
    --mf-bloom-size: clamp(320px, 42vw, 540px);
    z-index: 0;
    opacity: 0.85;
}

.hero-orb-caption {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-soft);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

/* The page-level aura: pin it to the hero, keep it whisper-quiet under content. */
.hero-aura {
    z-index: 0;
    opacity: 0.55;
}

/* ==================== PAGE-LOAD REVEAL SEQUENCE ==================== */
/* One orchestrated entrance: each element fades + lifts in, staggered by its
 * data-reveal index. Fully disabled under prefers-reduced-motion. */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: reveal-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reveal[data-reveal="1"] { animation-delay: 0.05s; }
.reveal[data-reveal="2"] { animation-delay: 0.13s; }
.reveal[data-reveal="3"] { animation-delay: 0.21s; }
.reveal[data-reveal="4"] { animation-delay: 0.30s; }
.reveal[data-reveal="5"] { animation-delay: 0.39s; }
.reveal[data-reveal="6"] { animation-delay: 0.48s; }
.reveal[data-reveal="7"] { animation-delay: 0.57s; }
.reveal[data-reveal="8"] { animation-delay: 0.66s; }
.reveal[data-reveal="9"] { animation-delay: 0.75s; }
.reveal[data-reveal="10"] { animation-delay: 0.84s; }

@keyframes reveal-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect reduced-motion: show everything immediately, no looping ambience,
 * no transform-based hover lift. Color/opacity hovers still work. */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .hero::before,
    .hero::after,
    .eyebrow-dot {
        animation: none !important;
    }

    .btn-cta,
    .features li,
    .logo-mark,
    .action-btn,
    .auth-btn,
    .badge {
        transition: background-color 0.2s ease, color 0.2s ease,
            border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .btn-cta:hover,
    .features li:hover,
    .logo-mark:hover,
    .auth-btn:hover,
    .badge:hover,
    .action-btn:hover {
        transform: none !important;
    }

    .btn-cta.primary:hover .btn-cta-arrow {
        transform: none !important;
    }
}

/* ==================== GAME-LIKE BUTTONS (legacy, kept for other surfaces) ==================== */

.btn-game {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    background: var(--bg-card);
    border: 3px solid var(--bg-soft);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-medium);
    text-decoration: none;
    overflow: hidden;
}

.btn-game::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-purple) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-game:hover {
    transform: scale(1.08);
    border-color: var(--accent-green-deep);
    box-shadow: var(--shadow-lifted);
}

.btn-game:hover::before {
    opacity: 0.15;
}

.btn-game-icon {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xs);
    transition: all 0.3s ease;
}

.btn-game-icon svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    fill: none;
    transition: all 0.3s ease;
}

.btn-game:hover .btn-game-icon {
    transform: scale(1.15);
}

.btn-game:hover .btn-game-icon svg {
    stroke: var(--text-primary);
}

.btn-game-label {
    position: relative;
    z-index: 1;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    transition: color 0.3s ease;
}

.btn-game:hover .btn-game-label {
    color: var(--text-primary);
}

.btn-game.primary {
    background: var(--solid-surface);
    border-color: var(--solid-surface);
}

.btn-game.primary::before {
    background: linear-gradient(135deg, var(--accent-green-deep) 0%, var(--accent-cyan) 100%);
}

.btn-game.primary .btn-game-icon svg {
    stroke: var(--on-solid-muted);
}

.btn-game.primary .btn-game-label {
    color: var(--on-solid-muted);
}

.btn-game.primary:hover {
    border-color: var(--accent-green-deep);
}

.btn-game.primary:hover .btn-game-icon svg {
    stroke: var(--on-solid);
}

.btn-game.primary:hover .btn-game-label {
    color: var(--on-solid);
}

/* Secondary/disabled game button */
.btn-game.secondary {
    background: var(--bg-soft);
    border-color: var(--bg-soft);
}

.btn-game.secondary .btn-game-icon svg {
    stroke: var(--text-muted);
}

.btn-game.secondary .btn-game-label {
    color: var(--text-secondary);
}

/* ==================== LEGACY BUTTONS ==================== */

.btn-primary {
    background: var(--solid-surface);
    color: var(--on-solid);
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: var(--radius-full);
    font-size: 1.0625rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lifted);
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-soft);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-soft);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    border-color: var(--text-primary);
    transform: scale(1.05);
}

.btn-icon.active {
    background: var(--solid-surface);
    color: var(--on-solid);
    border-color: var(--solid-surface);
}

.btn-danger {
    background: var(--error);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    filter: brightness(0.9);
}

/* ==================== FORM PAGE ==================== */

.form-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: var(--bg-cream);
    position: relative;
    overflow: hidden;
}

.form-page::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vw;
    height: 150vw;
    background: radial-gradient(circle,
            rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.15) 15%,
            rgba(129, 199, 132, 0.1) 15.1%, rgba(129, 199, 132, 0.1) 35%,
            rgba(200, 230, 201, 0.05) 35.1%, rgba(200, 230, 201, 0.05) 60%,
            transparent 60.1%);
    border-radius: 50%;
    z-index: 0;
    transform: translate(-50%, -50%);
    animation: grow-circles 15s infinite alternate ease-in-out;
}

.form-page::after {
    display: none;
}

@keyframes grow-circles {
    0% {
        transform: translate(-50%, -50%) scale(0.85);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.form-container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    max-height: 100vh;
    overflow: visible;
    position: relative;
    z-index: 1;
    align-items: flex-start;
}

.form-main {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    padding: var(--spacing-xl);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.form-sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--spacing-xl);
    background: var(--glass-bg);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    position: sticky;
    top: 25vh;
}

.form-header {
    margin-bottom: var(--spacing-md);
}

.form-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.form-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 2px solid transparent;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) inset;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-green-deep);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 4px rgba(129, 199, 132, 0.15);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input.input-error {
    border-color: var(--error);
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
    max-height: 100px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A4A4A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2rem;
}

.form-helper {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.loading {
    text-align: center;
    color: var(--success);
    font-weight: 600;
    margin-top: var(--spacing-sm);
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
}

.loading.visible {
    display: flex;
}

.loading-sidebar {
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--success);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Game Button */
.btn-form-game {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 180px;
    background: var(--surface-2, rgba(0, 0, 0, 0.03));
    border: none;
    border-radius: var(--radius-xl);
    cursor: not-allowed;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) inset;
    overflow: hidden;
}

.btn-form-game::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-cyan) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-form-game.active {
    background: linear-gradient(135deg, var(--accent-green-deep) 0%, var(--success) 100%);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.btn-form-game.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: cta-shine 4s ease-in-out infinite;
}

@keyframes cta-shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.btn-form-game.active:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.btn-form-game.active:hover::before {
    opacity: 0;
}

.btn-form-game-icon {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
    transition: all 0.3s ease;
}

.btn-form-game-icon svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    fill: none;
    transition: all 0.3s ease;
}

.btn-form-game.active .btn-form-game-icon svg {
    stroke: #FFFFFF;
}

.btn-form-game.active:hover .btn-form-game-icon {
    transform: scale(1.15);
}

.btn-form-game-label {
    position: relative;
    z-index: 1;
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.btn-form-game.active .btn-form-game-label {
    color: #FFFFFF;
}

/* Icon swap */
.btn-form-game .icon-inactive {
    display: block;
}

.btn-form-game .icon-active {
    display: none;
}

.btn-form-game.active .icon-inactive {
    display: none;
}

.btn-form-game.active .icon-active {
    display: block;
}

.interview-info {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-cream);
    border-radius: var(--radius-sm);
}

.interview-info h3 {
    color: var(--text-primary);
    font-size: 0.8125rem;
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}

.interview-info ul {
    list-style: none;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.interview-info li {
    margin: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.interview-info li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 5px;
    height: 5px;
    background: var(--accent-green-deep);
    border-radius: 50%;
}

/* ==================== INTERVIEW ROOM ==================== */

.interview-page {
    height: 100vh;
    background: var(--bg-cream);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Progress Bar Header */
.progress-header {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-card);
    border-bottom: 1px solid var(--bg-soft);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    transition: background 0.5s ease, border-color 0.5s ease;
}

/* Stage-specific background colors */
/* Color progression: Green (Welcome) -> Teal (Intro) -> Blue (Experience) -> Amber (Company Fit) -> Indigo (Closing) */

.progress-header[data-current-stage="welcome"] {
    background: rgba(74, 222, 128, 0.08);
    border-bottom-color: rgba(74, 222, 128, 0.2);
}

.progress-header[data-current-stage="self_intro"] {
    background: rgba(20, 184, 166, 0.10);
    border-bottom-color: rgba(20, 184, 166, 0.25);
}

.progress-header[data-current-stage="past_experience"] {
    background: rgba(59, 130, 246, 0.10);
    border-bottom-color: rgba(59, 130, 246, 0.25);
}

.progress-header[data-current-stage="company_fit"] {
    background: rgba(245, 158, 11, 0.10);
    border-bottom-color: rgba(245, 158, 11, 0.25);
}

.progress-header[data-current-stage="closing"] {
    background: rgba(99, 102, 241, 0.08);
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

.progress-container {
    max-width: 800px;
    margin: 0 auto;
}

.progress-stages {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    width: 100%;
}

.progress-line {
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-soft);
    transform: none;
    z-index: 0;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-green-deep);
    transition: width 0.5s ease, background 0.5s ease;
}

#stageDots {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Stage-specific progress fill colors */
.progress-header[data-current-stage="welcome"] .progress-fill {
    background: rgb(74, 222, 128);
}

.progress-header[data-current-stage="self_intro"] .progress-fill {
    background: rgb(20, 184, 166);
}

.progress-header[data-current-stage="past_experience"] .progress-fill {
    background: rgb(59, 130, 246);
}

.progress-header[data-current-stage="company_fit"] .progress-fill {
    background: rgb(245, 158, 11);
}

.progress-header[data-current-stage="closing"] .progress-fill {
    background: rgb(99, 102, 241);
}

.stage-dot {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.stage-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.stage-dot.active .stage-circle {
    border-color: var(--accent-green-deep);
    background: var(--accent-green);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Stage Progress Colors - Natural Progression */
/* Green -> Teal -> Blue -> Indigo */

.stage-dot.completed .stage-circle {
    border-color: var(--accent-green-deep);
    background: var(--accent-green-deep);
    color: white;
    transition: all 0.3s ease;
}

/* Stage-specific active dot colors */
.progress-header[data-current-stage="welcome"] .stage-dot.active .stage-circle {
    border-color: rgb(34, 197, 94);
    background: rgba(34, 197, 94, 0.15);
}

.progress-header[data-current-stage="self_intro"] .stage-dot.active .stage-circle {
    border-color: rgb(20, 184, 166);
    background: rgba(20, 184, 166, 0.15);
}

.progress-header[data-current-stage="past_experience"] .stage-dot.active .stage-circle {
    border-color: rgb(59, 130, 246);
    background: rgba(59, 130, 246, 0.15);
}

.progress-header[data-current-stage="company_fit"] .stage-dot.active .stage-circle {
    border-color: rgb(245, 158, 11);
    background: rgba(245, 158, 11, 0.15);
}

.progress-header[data-current-stage="closing"] .stage-dot.active .stage-circle {
    border-color: rgb(99, 102, 241);
    background: rgba(99, 102, 241, 0.15);
}

/* Stage-specific completed dot colors */
.progress-header[data-current-stage="welcome"] .stage-dot.completed .stage-circle {
    border-color: rgb(34, 197, 94);
    background: rgb(34, 197, 94);
}

.progress-header[data-current-stage="self_intro"] .stage-dot.completed .stage-circle {
    border-color: rgb(20, 184, 166);
    background: rgb(20, 184, 166);
}

.progress-header[data-current-stage="past_experience"] .stage-dot.completed .stage-circle {
    border-color: rgb(59, 130, 246);
    background: rgb(59, 130, 246);
}

.progress-header[data-current-stage="company_fit"] .stage-dot.completed .stage-circle {
    border-color: rgb(245, 158, 11);
    background: rgb(245, 158, 11);
}

.progress-header[data-current-stage="closing"] .stage-dot.completed .stage-circle {
    border-color: rgb(99, 102, 241);
    background: rgb(99, 102, 241);
}

.stage-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.stage-dot.active .stage-label {
    color: var(--text-primary);
}

/* Main Interview Area */
.interview-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* Agent Side */
.agent-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    position: relative;
}

.agent-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

/* ==================== AGENT CIRCULAR VISUALIZER ==================== */

.agent-visualizer {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Voice circle container */
.voice-circle {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
}

/* Background circle outline */
.voice-circle-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px solid var(--bg-soft);
    pointer-events: none;
    /* A continuous, audio-INDEPENDENT breathing so the orb never looks frozen
       while waiting/connecting. Purely visual — does not touch the audio bars,
       the LiveKit connection, or any worker/agent logic. */
    animation: orbBreathe 3.2s ease-in-out infinite;
}
@keyframes orbBreathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.65; border-color: var(--bg-soft); }
    50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; border-color: color-mix(in srgb, var(--accent-green-deep) 40%, var(--bg-soft)); }
}
@media (prefers-reduced-motion: reduce) { .voice-circle-bg { animation: none; } }

/* Container for bars - must be positioned to allow absolute children */
.bars-container {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 0;
    left: 0;
}

/* Individual audio bar - uses transform-based positioning for proper outward growth */
.agent-bar {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-green-deep);
    left: 50%;
    top: 50%;
    margin-left: -2px;
    transform-origin: center top;
    border-radius: 2px;
    transition: height 0.07s ease-out;
    box-shadow: 0 0 6px var(--soul-glow);
}

/* Enhanced glow effect when speaking */
.agent-visualizer.speaking .agent-bar {
    box-shadow: 0 0 10px var(--accent-green-deep), 0 0 20px var(--soul-glow);
}

/* Agent Eyes Container */
.agent-eyes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.agent-eye {
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    position: relative;
    transition: all 0.15s ease;
}

.agent-eye::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
}

/* Blink animation */
.agent-eyes.blinking .agent-eye {
    height: 2px;
    border-radius: 2px;
}

.agent-eyes.blinking .agent-eye::after {
    opacity: 0;
}

/* Agent Caption */
.agent-caption {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    max-width: 350px;
    width: 100%;
    height: 4.25rem;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.caption-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

.caption-text.empty {
    color: var(--text-light);
    font-style: italic;
}

/* Candidate Side */
.candidate-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    position: relative;
}

.candidate-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

/* Candidate Card */
.candidate-card {
    background: var(--candidate-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    width: 100%;
    max-width: 380px;
    color: white;
    box-shadow: var(--shadow-lifted);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Video Feed Area */
.candidate-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #0D0D0D;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.candidate-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.video-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    color: var(--text-muted);
}

.video-placeholder svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    opacity: 0.5;
}

.video-placeholder span {
    font-size: 0.75rem;
    opacity: 0.5;
}

.candidate-video-container.video-off .candidate-video {
    display: none;
}

.candidate-video-container.video-off .video-placeholder {
    display: flex;
}

.video-toggle {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.video-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-toggle svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.video-toggle .icon-on {
    display: block;
}

.video-toggle .icon-off {
    display: none;
}

.video-toggle.off .icon-on {
    display: none;
}

.video-toggle.off .icon-off {
    display: block;
}

/* Candidate Info Row */
.candidate-info-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.candidate-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.candidate-name {
    font-size: 1.125rem;
    font-weight: 800;
    color: #FFFFFF;
    flex-shrink: 0;
}

.candidate-role {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

.candidate-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.candidate-level {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.candidate-company {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 4px;
}

.candidate-company svg {
    width: 12px;
    height: 12px;
    stroke: rgba(255, 255, 255, 0.5);
}

.candidate-company a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
}

.candidate-company a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* ==================== SPIKEY AUDIO VISUALIZER ==================== */

.audio-spikes-box {
    background: #0D0D0D;
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.spikes-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    width: 100%;
}

.spike-bar {
    width: 4px;
    background: var(--accent-cyan);
    border-radius: 2px;
    min-height: 3px;
    max-height: 100%;
    transition: height 0.05s ease;
    box-shadow: 0 0 6px var(--accent-cyan-glow);
}

/* Noise Warning */
.noise-warning {
    position: absolute;
    right: -180px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    max-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.noise-warning.visible {
    opacity: 1;
    visibility: visible;
}

.noise-warning-text {
    font-size: 0.6875rem;
    color: var(--warning);
    line-height: 1.3;
}

/* Candidate Caption */
.candidate-caption {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    max-width: 380px;
    width: 100%;
    height: 4.25rem;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Interview Controls */
.interview-controls {
    position: fixed;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lifted);
    z-index: 100;
}

/* Connection Status */
.connection-status {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-card);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 100;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-status 2s ease-in-out infinite;
}

.status-indicator.connecting {
    background: var(--warning);
}

.status-indicator.connected {
    background: var(--success);
}

.status-indicator.error {
    background: var(--error);
}

.status-indicator.disconnected {
    background: var(--text-light);
}

@keyframes pulse-status {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==================== CUSTOM MODAL ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-scrim);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lifted);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.modal-icon.warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning);
}

.modal-icon.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
}

.modal-icon.error {
    background: rgba(229, 57, 53, 0.1);
    color: var(--error);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9375rem;
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

/* ==================== STATE TRANSITION FLASH ==================== */

.state-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-green);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.3s ease;
}

.state-flash.active {
    animation: flash-dim 0.6s ease;
}

@keyframes flash-dim {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 0.15;
    }

    100% {
        opacity: 0;
    }
}

/* ==================== TIMER ==================== */

.stage-timer-display {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    background: var(--bg-card);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-soft);
    z-index: 50;
}

/* ==================== FOOTER ==================== */

footer {
    text-align: center;
    padding: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .interview-main {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        overflow-y: auto;
    }

    .agent-side,
    .candidate-side {
        padding: var(--spacing-sm);
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        max-width: 560px;
        justify-items: center;
        text-align: left;
    }

    .hero-lead {
        grid-column: 1;
        order: 2;
        width: 100%;
    }

    /* The orb greets you first, above the copy, when columns collapse. */
    .hero-orb-stage {
        grid-column: 1;
        order: 1;
    }

    .hero-orb {
        width: clamp(180px, 52vw, 240px);
        height: clamp(180px, 52vw, 240px);
    }
    .hero-orb .mf-rays { --mf-rays-size: clamp(180px, 52vw, 240px); }

    .hero-orb-bloom {
        --mf-bloom-size: clamp(300px, 80vw, 460px);
    }

    .tagline {
        max-width: 48ch;
    }

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

@media (max-width: 850px) {
    .form-container {
        grid-template-columns: 1fr;
        max-width: 600px;
        align-items: stretch;
    }

    .form-sidebar {
        position: relative;
        top: 0;
        margin-top: var(--spacing-md);
    }
}

@media (max-width: 768px) {

    html,
    body {
        overflow: auto;
    }

    .hero {
        height: auto;
        min-height: 100svh;
        padding: clamp(4.5rem, 14vw, 6rem) var(--spacing-md) var(--spacing-2xl);
        justify-content: flex-start;
    }

    .hero-content {
        gap: var(--spacing-md);
    }

    h1 {
        font-size: clamp(2.1rem, 11vw, 2.75rem);
    }

    .tagline {
        font-size: 0.95rem;
        max-width: none;
    }

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

    .form-container {
        margin: var(--spacing-sm);
        padding: var(--spacing-md);
    }

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

    .progress-stages {
        gap: var(--spacing-xs);
    }

    .stage-label {
        display: none;
    }

    .agent-visualizer {
        width: 160px;
        height: 160px;
    }

    .voice-circle {
        width: 160px;
        height: 160px;
    }

    .voice-circle-bg {
        width: 120px;
        height: 120px;
    }

    .bars-container {
        width: 160px;
        height: 160px;
    }

    .interview-controls {
        bottom: var(--spacing-xs);
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .btn-game,
    .btn-form-game {
        width: 110px;
        height: 110px;
    }

    .btn-game-icon svg,
    .btn-form-game-icon svg {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .candidate-card {
        padding: var(--spacing-sm);
    }

    .candidate-name {
        font-size: 1rem;
    }

    .noise-warning {
        right: auto;
        left: 50%;
        top: auto;
        bottom: -50px;
        transform: translateX(-50%);
    }

    /* CTAs go full-width and stack so they never overflow on small phones */
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-cta {
        justify-content: center;
        width: 100%;
    }

    /* Hide the "About" word; the icon + aria-label remain */
    .action-btn-about .action-btn-label {
        display: none;
    }

    .action-btn-about {
        width: 2.25rem;
        padding: 0;
    }
}

/* Extra-narrow guard (~360px and below): keep features single-column,
 * trim badge wrapping pressure, no horizontal scroll. */
@media (max-width: 360px) {
    .hero {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    .tech-badges {
        gap: 0.375rem;
    }

    /* Orb scales down so it never crowds the copy on the smallest phones. */
    .hero-orb {
        --mf-orb-size: clamp(140px, 52vw, 180px);
    }

    .hero-orb-bloom {
        --mf-bloom-size: clamp(240px, 86vw, 340px);
    }
}

/* ==================== ACTION BUTTONS (Settings, GitHub, About) ==================== */

.action-buttons {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.action-btn {
    height: 2.5rem;
    min-width: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--text-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease,
        border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    font-family: inherit;
}

.action-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--brutal-shadow);
    border-color: var(--accent-green-deep);
}

/* Keyboard focus ring on every header control (AA-visible in both themes) */
.action-btn:focus-visible,
.auth-btn:focus-visible,
.btn-cta:focus-visible,
.logo-mark:focus-visible,
.badge:focus-visible,
.settings-dropdown-item:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.action-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* "About" control — icon + label, the single consolidated entry point */
.action-btn-about {
    gap: 0.45rem;
    padding: 0 0.75rem;
}

.action-btn-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
}

.action-btn-primary {
    background: var(--solid-surface);
    color: var(--on-solid);
    border-color: var(--solid-surface);
}

.action-btn-primary:hover {
    background: var(--accent-pink-deep);
    border-color: var(--accent-pink-deep);
    color: var(--on-accent);
}

.action-btn-home {
    padding: 0 0.625rem;
    gap: 0.375rem;
}

.action-btn-home .home-logo {
    width: 1.5rem;
    height: 1.5rem;
}

.action-btn-home .home-icon {
    width: 1rem;
    height: 1rem;
}

.action-btn-back {
    position: fixed;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    z-index: 1000;
}

.action-btn-back:hover {
    background: var(--bg-soft);
}

@media (max-width: 768px) {
    .action-buttons {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        gap: 0.375rem;
    }

    .action-btn {
        height: 2.25rem;
        min-width: 2.25rem;
    }

    .action-btn svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    .action-btn-back {
        top: var(--spacing-sm);
        left: var(--spacing-sm);
    }
}

/* ==================== AUTH HEADER ==================== */

.auth-header {
    position: fixed;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 999;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
    border-color: var(--hairline-strong);
}

.auth-btn svg {
    width: 18px;
    height: 18px;
}

/* Primary auth action (Sign Up) — header.js emits class="auth-btn primary".
 * Uses the solid-surface tokens so text stays AA in light AND dark. */
.auth-btn.primary,
.signup-btn {
    background: var(--solid-surface);
    color: var(--on-solid);
    border-color: var(--solid-surface);
    font-weight: 600;
}

.auth-btn.primary:hover,
.signup-btn:hover {
    background: var(--solid-surface-hover);
    border-color: var(--solid-surface-hover);
    color: var(--on-solid);
}

.account-btn {
    font-weight: 600;
}

@media (max-width: 768px) {
    .auth-header {
        top: var(--spacing-sm);
        left: var(--spacing-sm);
        gap: 0.5rem;
    }

    .auth-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Auth Avatar in Header */
.auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--hairline);
}

.auth-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #81C784, #4CAF50);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}


/**
 * MockFlow-AI Header Component Additions
 * Additional styles for header.js components
 */

/* Sponsor button - Pink heart style */
.action-btn-sponsor {
    color: #db61a2;
    border-color: var(--text-primary);
}

.action-btn-sponsor:hover {
    background: rgba(219, 97, 162, 0.08);
    border-color: #db61a2;
    color: #db61a2;
}

.action-btn-sponsor svg {
    stroke: #db61a2;
    fill: none;
    transition: fill 0.2s ease;
}

.action-btn-sponsor:hover svg {
    fill: rgba(219, 97, 162, 0.15);
}

/* Settings dropdown */
.settings-dropdown {
    position: relative;
}

.settings-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    background: var(--dropdown-bg);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 200;
}

.settings-dropdown-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary, #1a1a1a);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease;
}

.settings-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.settings-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.settings-dropdown-item:hover {
    background: var(--bg-warm);
}

.settings-dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary, #666);
}

.settings-dropdown-item:hover svg {
    color: var(--accent-green-deep);
}

/* ==================== GLOBAL TOAST ====================
 * Lightweight, dependency-free toast surfaced via window.showToast() in
 * static/utils.js. Token-based so it reads correctly in light and dark.
 */
.app-toast-stack {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    pointer-events: none;
    max-width: min(90vw, 360px);
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-lifted);
    border-left: 4px solid var(--info);
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast--leaving {
    opacity: 0;
    transform: translateY(10px);
}

.app-toast--success {
    border-left-color: var(--success);
}

.app-toast--error {
    border-left-color: var(--error);
}

.app-toast-text {
    flex: 1;
}