/* ============================================
   DIAGNOSTIC V8 — Redesigned UI
   Brutalist Mono Aesthetic
   Two modes: ZB (dark terminal) + Corporate (light airy)
   ============================================ */

/* ============================================
   FONT NOTE: Inherits Inter from body (no custom font needed)
   ============================================ */

/* ============================================
   BASE VARIABLES (ZB / Dark Mode)
   ============================================ */

:root {
    /* --- Core palette --- */
    --v8-bg: #0c0c0c;
    --v8-surface: #131313;
    --v8-surface-alt: #0f0f0f;
    --v8-border: #1e1e1e;
    --v8-border-light: #282828;
    --v8-text: #e0e0e0;
    --v8-text-muted: #888;
    --v8-text-dim: #555;
    --v8-text-ghost: #444;
    --v8-text-invisible: #252525;
    --v8-text-label: #555;
    --v8-accent: #ffffff;
    --v8-success: #22c55e;
    --v8-warning: #f97316;
    --v8-error: #ef4444;
    --v8-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --v8-placeholder: #555;

    /* --- Button palette --- */
    --v8-btn-bg: #fff;
    --v8-btn-color: #000;
    --v8-btn-hover-bg: #ddd;
    --v8-btn-hover-color: #000;
    --v8-btn-disabled-bg: #1a1a1a;
    --v8-btn-disabled-color: #444;
    --v8-btn-secondary-bg: transparent;
    --v8-btn-secondary-color: #666;
    --v8-btn-secondary-border: var(--v8-border-light);
    --v8-btn-secondary-hover-bg: transparent;
    --v8-btn-secondary-hover-color: var(--v8-text);
    --v8-btn-secondary-hover-border: #555;

    /* --- Option palette --- */
    --v8-option-border: #222;
    --v8-option-color: #aaa;
    --v8-option-hover-bg: #1a1a1a;
    --v8-option-hover-border: #3a3a3a;
    --v8-option-hover-color: #fff;
    --v8-option-selected-bg: #fff;
    --v8-option-selected-color: var(--v8-bg);
    --v8-option-selected-border: #fff;
    --v8-option-selected-num: rgba(12, 12, 12, 0.4);

    /* --- Bar / progress palette --- */
    --v8-bar-bg: #1a1a1a;
    --v8-dot-done: #555;
    --v8-dot-pending: var(--v8-border);

    /* --- Spacing scale --- */
    --v8-space-xs: 10px;
    --v8-space-sm: 16px;
    --v8-space-md: 28px;
    --v8-space-lg: 48px;
    --v8-space-xl: 64px;
    --v8-space-2xl: 80px;
}

/* ============================================
   MAIN SECTION RESET
   ============================================ */

#diagnostic-section {
    width: 100%;
    min-height: 50vh;
    background: var(--v8-bg);
    color: var(--v8-text);
    font-family: inherit;
    position: relative;
    scroll-margin-top: 80px;
}

/* Reset using :where() for zero specificity — lets component styles win */
:where(#diagnostic-section) * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#diagnostic-section ::selection {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   SCANLINES OVERLAY (ZB mode only)
   ============================================ */

.v8-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.005) 2px,
        rgba(255, 255, 255, 0.005) 4px
    );
}

/* ============================================
   CONTAINER — Full-page centered layout
   ============================================ */

.v8-container {
    max-width: 100%;
    min-height: calc(50vh - 40px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 32px 40px;
}

/* ============================================
   MAIN WORKSPACE — Constrained width, left-aligned
   ============================================ */

.v8-main {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.v8-main.fade {
    opacity: 0;
    transform: translateY(6px);
}

/* ============================================
   VERDICT — Collapsed state (after CTA click)
   ============================================ */

.v8-verdict-stage.v8-collapsed {
    opacity: 0;
    height: 0 !important;
    overflow: hidden;
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.v8-verdict-nav.v8-collapsed {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* ============================================
   VERDICT — Contextual navigation (← prev / next →)
   ============================================ */

.v8-verdict-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--v8-space-md);
    margin-bottom: var(--v8-space-md);
    min-height: 32px;
}

.v8-verdict-nav-link {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 8px 0;
}

.v8-verdict-nav-link:hover {
    color: var(--v8-text);
}

.v8-verdict-nav-link:empty {
    visibility: hidden;
    pointer-events: none;
}

/* ============================================
   SHARED COMPONENTS — Buttons & Inputs
   ============================================ */

/* --- Primary Button --- */
.v8-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 32px;
    background: var(--v8-btn-bg);
    color: var(--v8-btn-color);
    border: none;
    border-radius: 2px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: var(--v8-space-md);
    min-height: 44px;
}

.v8-btn-primary:hover {
    background: var(--v8-btn-hover-bg);
    color: var(--v8-btn-hover-color);
    transform: translateY(-1px);
}

.v8-btn-primary:disabled {
    background: var(--v8-btn-disabled-bg);
    color: var(--v8-btn-disabled-color);
    cursor: not-allowed;
    transform: none;
}

.v8-btn-primary.v8-btn-ready {
    background: var(--v8-text);
    color: var(--v8-bg);
}

.v8-btn-primary.v8-btn-ready:hover {
    background: var(--v8-text-muted);
    color: var(--v8-bg);
}

/* --- Secondary Button --- */
.v8-btn-secondary {
    padding: 14px 32px;
    background: var(--v8-btn-secondary-bg);
    color: var(--v8-btn-secondary-color);
    border: 1px solid var(--v8-btn-secondary-border);
    border-radius: 2px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}

.v8-btn-secondary:hover {
    border-color: var(--v8-btn-secondary-hover-border);
    background: var(--v8-btn-secondary-hover-bg);
    color: var(--v8-btn-secondary-hover-color);
}

/* --- Text Input --- */
.v8-input {
    width: 100%;
    padding: 12px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--v8-border-light);
    color: var(--v8-text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    border-radius: 0;
    -webkit-appearance: none;
    min-height: 48px;
}

.v8-input:focus {
    border-bottom-color: var(--v8-text);
}

.v8-input::placeholder {
    color: var(--v8-placeholder);
    font-style: italic;
}

/* --- Textarea --- */
.v8-textarea {
    width: 100%;
    padding: 12px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--v8-border);
    color: var(--v8-text-muted);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    resize: none;
    min-height: 60px;
    max-height: 160px;
    transition: border-color 0.3s;
    border-radius: 0;
}

.v8-textarea:focus {
    border-bottom-color: var(--v8-text);
}

.v8-textarea::placeholder {
    color: var(--v8-placeholder);
    font-style: normal;
}

/* ============================================
   LEAD SCREEN — Entry form
   ============================================ */

.v8-lead {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
    animation: v8-logIn 0.5s ease-out;
}

.v8-lead-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--v8-text-ghost);
    margin-bottom: var(--v8-space-md);
}

.v8-lead-desc {
    font-size: 30px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--v8-text);
    margin-bottom: var(--v8-space-lg);
    white-space: pre-line;
}

.v8-form {
    display: flex;
    flex-direction: column;
    gap: var(--v8-space-md);
}

.v8-form-row {
    display: flex;
    gap: 24px;
}

.v8-form-row .v8-form-group {
    flex: 1;
}

.v8-form-group {
    display: flex;
    flex-direction: column;
}

.v8-form-group label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
    display: block;
    margin-bottom: var(--v8-space-sm);
}

.v8-privacy {
    font-size: 12px;
    color: var(--v8-text-invisible);
    text-align: center;
    margin-top: var(--v8-space-md);
}

/* ============================================
   QUIZ SCREEN — Questions & Options
   ============================================ */

.v8-quiz {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

/* --- Quiz Header --- */
.v8-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--v8-space-md);
}

.v8-quiz-header-left {
    display: flex;
    align-items: center;
    gap: var(--v8-space-sm);
}

.v8-step-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
}

.v8-timer {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--v8-text-ghost);
}

.v8-quiz-separator {
    border: none;
    border-bottom: 1px solid var(--v8-border);
    margin-bottom: var(--v8-space-md);
}

/* --- Progress Dots --- */
.v8-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.v8-dot {
    height: 6px;
    border-radius: 3px;
    transition: all 0.4s ease;
}

.v8-dot.done {
    width: 6px;
    background: var(--v8-dot-done);
}

.v8-dot.current {
    width: 20px;
    background: var(--v8-text);
}

.v8-dot.pending {
    width: 6px;
    background: var(--v8-dot-pending);
}

/* --- Question Text --- */
.v8-question {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--v8-text);
    margin-bottom: var(--v8-space-md);
    min-height: 48px;
    overflow: hidden;
    transition: height 0.3s ease;
}

.v8-cursor {
    display: inline-block;
    width: 2px;
    height: 36px;
    background: var(--v8-text);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: v8-blink 1s step-end infinite;
}

.v8-cursor.hidden {
    opacity: 0;
}

/* --- Answer Options --- */
.v8-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    transform: translateY(14px);
    transition: all 0.5s var(--v8-ease);
    pointer-events: none;
}

.v8-options.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.v8-option {
    width: 100%;
    text-align: left;
    padding: 18px 20px 18px 56px;
    background: var(--v8-surface);
    border: 1px solid var(--v8-option-border);
    border-radius: 10px;
    color: var(--v8-option-color);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.v8-option:hover:not(:disabled):not(.selected):not(.dimmed) {
    background: var(--v8-option-hover-bg);
    border-color: var(--v8-option-hover-border);
    color: var(--v8-option-hover-color);
    transform: translateX(4px);
}

.v8-option:disabled {
    cursor: default;
}

.v8-option .v8-option-num {
    position: absolute;
    left: 20px;
    top: 18px;
    font-size: 11px;
    color: var(--v8-text-ghost);
}

.v8-option.selected {
    background: var(--v8-option-selected-bg);
    color: var(--v8-option-selected-color);
    border-color: var(--v8-option-selected-border);
}

.v8-option.selected .v8-option-num {
    color: var(--v8-option-selected-num);
}

.v8-option.dimmed {
    opacity: 0.18;
    pointer-events: none;
}

/* ============================================
   FEEDBACK — Inline after option select
   ============================================ */

.v8-feedback {
    margin-top: var(--v8-space-lg);
    border-top: 1px solid var(--v8-border);
    padding-top: var(--v8-space-md);
}

.v8-feedback-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-ghost);
    margin-bottom: var(--v8-space-sm);
}

.v8-feedback-line {
    font-size: 14px;
    line-height: 1.7;
    color: transparent;
    transition:
        color 0.5s ease,
        transform 0.5s ease;
    transform: translateY(8px);
    padding-left: 20px;
    border-left: 1px solid var(--v8-border-light);
    margin-bottom: 10px;
}

.v8-feedback-line.visible {
    color: var(--v8-text-dim);
    transform: translateY(0);
}

/* --- Transcript Inline (compact, under question text) --- */
.v8-transcript-inline {
    margin: 12px 0 8px;
    max-height: 120px;
    overflow-y: auto;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.6;
    color: var(--v8-text-dim);
    letter-spacing: 0.02em;
}

.v8-transcript-inline:empty {
    display: none;
}

.v8-transcript-inline .transcript-line {
    padding: 2px 0;
    opacity: 0;
    animation: v8-transcript-fade-in 0.4s ease forwards;
}

.v8-transcript-inline .transcript-line.speaking {
    color: var(--v8-text);
}

.v8-transcript-inline .transcript-line.muted {
    color: var(--v8-text-ghost);
}

.v8-transcript-inline .audio-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--v8-accent);
    margin-right: 6px;
    vertical-align: middle;
    animation: v8-audio-pulse 1s ease-in-out infinite;
}

@keyframes v8-transcript-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* --- Audio Waveform Indicator (replaces transcript when audio is ON) --- */
.v8-audio-wave {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
    padding: 4px 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.v8-audio-wave.v8-audio-wave-out {
    opacity: 0;
}

.v8-audio-wave-bar {
    display: inline-block;
    width: 3px;
    border-radius: 2px;
    background: var(--v8-text-ghost);
    animation: v8-wave 1s ease-in-out infinite;
}

.v8-audio-wave-bar:nth-child(1) {
    height: 6px;
}
.v8-audio-wave-bar:nth-child(2) {
    height: 12px;
}
.v8-audio-wave-bar:nth-child(3) {
    height: 8px;
}
.v8-audio-wave-bar:nth-child(4) {
    height: 14px;
}

@keyframes v8-wave {
    0%,
    100% {
        transform: scaleY(0.4);
    }
    50% {
        transform: scaleY(1);
    }
}

/* --- Feedback Fullscreen (immersive, replaces quiz content) --- */
.v8-feedback-fullscreen {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 40vh;
}

/* ============================================
   ANALYSIS SCREEN — Progress animation
   ============================================ */

.v8-analysis {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.v8-analysis-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
    margin-bottom: var(--v8-space-lg);
}

.v8-analysis-pct {
    font-size: 42px;
    font-weight: 300;
    color: var(--v8-text);
    margin-bottom: var(--v8-space-lg);
    font-variant-numeric: tabular-nums;
}

.v8-analysis-bar {
    width: 100%;
    height: 2px;
    background: var(--v8-bar-bg);
    margin-bottom: var(--v8-space-lg);
    overflow: hidden;
}

.v8-analysis-bar-fill {
    height: 100%;
    background: var(--v8-text-ghost);
    transition: width 0.1s linear;
    width: 0%;
}

.v8-analysis-msg {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-ghost);
    min-height: 18px;
}

/* ============================================
   VERDICT SCREEN — Results & CTAs
   ============================================ */

.v8-verdict {
    max-width: 760px;
    width: 100%;
}

/* --- Stage container: holds ephemeral blocks stacked --- */
.v8-verdict-stage {
    position: relative;
    overflow: hidden;
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: height;
}

/* --- Stage blocks: absolutely positioned, directional cross-fade --- */
.v8-verdict-stage .v8-verdict-block {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    will-change: opacity, transform;
}

.v8-verdict-stage .v8-verdict-block.v8-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Exiting block fades out upward (next direction) */
.v8-verdict-stage .v8-verdict-block.v8-exiting {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* Back direction: entering block comes from top, exiting goes down */
.v8-verdict-stage.v8-dir-back .v8-verdict-block {
    transform: translateY(-20px);
}
.v8-verdict-stage.v8-dir-back .v8-verdict-block.v8-active {
    transform: translateY(0);
}
.v8-verdict-stage.v8-dir-back .v8-verdict-block.v8-exiting {
    transform: translateY(20px);
}

.v8-verdict-stage .v8-verdict-block.v8-measuring {
    opacity: 0;
    position: static;
    pointer-events: none;
}

/* --- Persist blocks: normal flow, slide up --- */
.v8-verdict-persist .v8-verdict-block {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.v8-verdict-persist .v8-verdict-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.v8-verdict-persist .v8-verdict-block.v8-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.v8-verdict-persist .v8-verdict-block.visible.v8-hidden {
    /* Should not happen, but safety */
    max-height: none;
}

/* Remove v8-hidden when visible is added */
.v8-verdict-persist .v8-verdict-block:not(.v8-hidden) {
    max-height: 600px;
}

/* --- Verdict Header --- */
.v8-verdict-header {
    margin-bottom: var(--v8-space-md);
}

.v8-verdict-name {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
    margin-bottom: 10px;
}

.v8-verdict-sep {
    border: none;
    border-bottom: 1px solid var(--v8-border);
}

/* --- Profile --- */
.v8-verdict-profile {
    margin-bottom: var(--v8-space-lg);
}

.v8-verdict-profile-name {
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 16px;
}

.v8-verdict-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.v8-verdict-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
}

.v8-verdict-pct {
    font-size: 11px;
    color: var(--v8-text-ghost);
    font-variant-numeric: tabular-nums;
}

.v8-verdict-bar {
    flex: 1;
    height: 2px;
    background: var(--v8-bar-bg);
    overflow: hidden;
}

.v8-verdict-bar-fill {
    height: 100%;
    transition: width 1.2s var(--v8-ease) 0.3s;
    width: 0%;
}

/* --- Verdict Sections (What I Read / What It Means) --- */
.v8-verdict-section {
    margin-bottom: var(--v8-space-md);
}

.v8-verdict-section-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
    margin-bottom: 14px;
}

.v8-verdict-section-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--v8-text-muted);
}

/* --- Lever Box --- */
.v8-verdict-lever {
    margin-bottom: var(--v8-space-lg);
    padding: 22px;
    background: var(--v8-surface-alt);
    border-radius: 10px;
}

.v8-verdict-lever-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
    opacity: 0.7;
}

.v8-verdict-lever-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--v8-text-muted);
}

/* --- CTAs --- */
.v8-verdict-ctas {
    border-top: 1px solid var(--v8-border);
    padding-top: var(--v8-space-md);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.v8-verdict-cta-row {
    display: flex;
    gap: 14px;
}

.v8-verdict-cta-row .v8-btn-secondary {
    flex: 1;
}

/* --- Message Block --- */
.v8-verdict-message {
    margin-top: var(--v8-space-lg);
    padding-top: var(--v8-space-md);
    border-top: 1px solid var(--v8-border);
}

.v8-verdict-message-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v8-text-dim);
    margin-bottom: var(--v8-space-sm);
}

/* Send button in verdict message */
.v8-btn-send {
    margin-top: var(--v8-space-sm);
    font-size: 11px;
    padding: 14px 32px;
}

.v8-message-status {
    margin-top: 10px;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--v8-success);
    min-height: 16px;
}

.v8-confirmation-msg {
    font-size: 14px;
    line-height: 1.6;
    color: var(--v8-text-muted);
    padding: var(--v8-space-md) 0;
    animation: v8-logIn 0.5s ease-out;
}

/* --- Booking / Cal.com Inline Embed --- */
.v8-verdict-booking {
    margin-top: var(--v8-space-lg);
    /* Breakout: column_view needs ~1000px+, escape the 760px .v8-main */
    width: calc(100vw - 48px);
    max-width: 1100px;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* Cal.com inline container — centered, scaled, fixed height, no external scroll */
.v8-cal-inline {
    width: 100%;
    height: 580px;
    max-width: 900px;
    margin: 0 auto;
    transform: scale(0.9);
    transform-origin: center top;
    overflow: hidden;
    border-radius: 12px;
    background: #1a1a1a;
}

/* Cal.com iframe — fills the fixed container, no scroll leak */
.v8-cal-inline iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 12px;
    color-scheme: dark;
    overflow: hidden !important;
}

/* Book CTA button — visible on mobile/tablet, hidden on wide desktop */
.v8-btn-book {
    font-size: 11px;
    padding: 14px 32px;
    width: 100%;
    letter-spacing: 0.1em;
}

/* Below 1024px: hide inline calendar (not enough width for column_view), show CTA popup */
@media (max-width: 1023px) {
    .v8-verdict-booking {
        display: none;
    }
}

/* Post-booking confirmation (simple: check + text only) */
.v8-post-booking-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--v8-space-lg) 0;
    margin-bottom: var(--v8-space-lg);
    animation: v8-logIn 0.5s ease-out;
}

.v8-post-booking-confirm {
    display: flex;
    align-items: center;
    gap: var(--v8-space-md);
}

.v8-post-booking-icon {
    font-size: 24px;
    color: var(--v8-success);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--v8-success);
    border-radius: 50%;
    flex-shrink: 0;
}

.v8-post-booking-text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--v8-text-muted);
}

/* Legacy booking confirmation (keep for backward compat) */
.v8-booking-confirm {
    display: flex;
    align-items: center;
    gap: var(--v8-space-md);
    padding: var(--v8-space-lg) 0;
    animation: v8-logIn 0.5s ease-out;
}

.v8-booking-confirm-icon {
    font-size: 28px;
    color: var(--v8-success);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--v8-success);
    border-radius: 50%;
    flex-shrink: 0;
}

.v8-booking-confirm-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--v8-text-muted);
    letter-spacing: 0.05em;
}

/* Secondary message form (below calendar) */
.v8-verdict-message-secondary {
    margin-top: var(--v8-space-lg);
    padding-top: var(--v8-space-md);
    border-top: 1px solid var(--v8-border);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.v8-verdict-message-secondary:hover,
.v8-verdict-message-secondary:focus-within {
    opacity: 1;
}

.v8-fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.v8-fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ============================================
   MOBILE LOG BAR
   ============================================ */

.v8-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(12, 12, 12, 0.95);
    border-top: 1px solid var(--v8-border);
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--v8-text-ghost);
    padding: 10px 16px;
    display: none;
    min-height: 46px;
    overflow: hidden;
    white-space: nowrap;
}

.v8-mobile-bar span {
    color: var(--v8-text-dim);
}

.v8-mobile-bar span.bright {
    color: var(--v8-text);
}

/* ============================================
   GHOST LOG OVERLAY
   ============================================ */

.v8-ghost-log {
    position: fixed;
    bottom: 12px;
    right: 16px;
    z-index: 101;
    max-width: 360px;
    padding: 8px 14px;
    background: rgba(12, 12, 12, 0.85);
    border: 1px solid var(--v8-border);
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--v8-text-ghost);
    border-radius: 6px;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    pointer-events: none;
}

.v8-ghost-log.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes v8-blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

@keyframes v8-logIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes v8-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.7;
    }
}

/* ============================================
   ============================================
   CORPORATE MODE OVERRIDES
   body:not(.zb-mode) = Light brutalist aesthetic
   Only color/theme changes — layout is shared
   ============================================
   ============================================ */

/* --- Variables (colors only) --- */
body:not(.zb-mode) #diagnostic-section {
    --v8-bg: #fafaf9;
    --v8-surface: #fafaf9;
    --v8-surface-alt: #f5f5f4;
    --v8-border: #d6d3d1;
    --v8-border-light: #d6d3d1;
    --v8-text: #1c1917;
    --v8-text-muted: #57534e;
    --v8-text-dim: #78716c;
    --v8-text-ghost: #a8a29e;
    --v8-text-invisible: #d6d3d1;
    --v8-text-label: #78716c;
    --v8-accent: #1c1917;
    --v8-placeholder: var(--v8-text-ghost);

    /* --- Button palette --- */
    --v8-btn-bg: #e7e5e4;
    --v8-btn-color: #78716c;
    --v8-btn-hover-bg: #d6d3d1;
    --v8-btn-hover-color: #1c1917;
    --v8-btn-disabled-bg: #f5f5f4;
    --v8-btn-disabled-color: #d6d3d1;
    --v8-btn-secondary-bg: #e7e5e4;
    --v8-btn-secondary-color: #78716c;
    --v8-btn-secondary-border: transparent;
    --v8-btn-secondary-hover-bg: #d6d3d1;
    --v8-btn-secondary-hover-color: #1c1917;
    --v8-btn-secondary-hover-border: transparent;

    /* --- Option palette --- */
    --v8-option-border: var(--v8-border);
    --v8-option-color: var(--v8-text-dim);
    --v8-option-hover-bg: #f5f5f4;
    --v8-option-hover-border: #a8a29e;
    --v8-option-hover-color: var(--v8-text);
    --v8-option-selected-bg: #1c1917;
    --v8-option-selected-color: #ffffff;
    --v8-option-selected-border: #1c1917;
    --v8-option-selected-num: rgba(255, 255, 255, 0.4);

    /* --- Bar / progress --- */
    --v8-bar-bg: #e7e5e4;
    --v8-dot-done: #a8a29e;
    --v8-dot-pending: #e7e5e4;
}

body:not(.zb-mode) #diagnostic-section ::selection {
    background: rgba(28, 25, 23, 0.12);
}

/* --- Scanlines: hidden in corporate --- */
body:not(.zb-mode) .v8-scanlines {
    display: none;
}

/* --- Corporate: no translateX on option hover --- */
body:not(.zb-mode) .v8-option:hover:not(:disabled):not(.selected):not(.dimmed) {
    transform: none;
}

/* --- Corporate: dimmed opacity --- */
body:not(.zb-mode) .v8-option.dimmed {
    opacity: 0.2;
}

/* --- Corporate: feedback visible color --- */
body:not(.zb-mode) .v8-feedback-line.visible {
    color: var(--v8-text-dim);
}

/* --- Corporate: ghost log --- */
body:not(.zb-mode) .v8-ghost-log {
    background: rgba(250, 250, 249, 0.9);
    border-color: var(--v8-border);
    color: var(--v8-text-dim);
}

/* --- Corporate: mobile log bar --- */
body:not(.zb-mode) .v8-mobile-bar {
    background: rgba(250, 250, 249, 0.95);
    border-top-color: var(--v8-border);
    color: var(--v8-text-ghost);
    font-size: 12px;
}

body:not(.zb-mode) .v8-mobile-bar span {
    color: #a8a29e;
}

body:not(.zb-mode) .v8-mobile-bar span.bright {
    color: #78716c;
}

/* ============================================
   CORPORATE — Accessibility: focus-visible
   ============================================ */

body:not(.zb-mode) .v8-btn-primary:focus-visible,
body:not(.zb-mode) .v8-btn-secondary:focus-visible,
body:not(.zb-mode) .v8-option:focus-visible {
    outline: 3px solid #1c1917;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Inputs: elegant bottom-border focus, WCAG AA compliant */
body:not(.zb-mode) .v8-input:focus-visible {
    outline: none;
    border-bottom-width: 2px;
    border-bottom-color: var(--v8-text);
}

body:not(.zb-mode) .v8-textarea:focus-visible {
    outline: none;
    border-bottom-color: var(--v8-text);
}

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

/* --- Tablet (< 900px) --- */
@media (max-width: 900px) {
    .v8-container {
        padding: 40px 24px 45px;
    }
}

/* --- Mobile (< 640px) --- */
@media (max-width: 640px) {
    .v8-container {
        padding: 32px 22px 45px;
    }

    /* Lead */
    .v8-lead-title {
        font-size: 10px;
    }

    .v8-lead-desc {
        font-size: 24px;
    }

    .v8-form {
        gap: 28px;
    }

    .v8-form-group label {
        font-size: 11px;
    }

    .v8-input {
        font-size: 14px;
        padding: 12px 0;
        min-height: 44px;
    }

    .v8-btn-primary {
        padding: 14px 28px;
        font-size: 11px;
        min-height: 42px;
    }

    .v8-btn-secondary {
        padding: 12px 24px;
        font-size: 11px;
    }

    .v8-privacy {
        font-size: 11px;
    }

    /* Quiz */
    .v8-quiz-separator {
        margin-bottom: 24px;
    }

    .v8-question {
        font-size: 20px;
        margin-bottom: 24px;
        min-height: 40px;
    }

    .v8-cursor {
        height: 24px;
    }

    .v8-options {
        gap: 10px;
    }

    .v8-option {
        font-size: 14px;
        padding: 14px 14px 14px 44px;
        border-radius: 6px;
    }

    .v8-option .v8-option-num {
        top: 16px;
        left: 16px;
        font-size: 11px;
    }

    /* Feedback */
    .v8-feedback-line {
        font-size: 14px;
    }

    /* Analysis */
    .v8-analysis-pct {
        font-size: 36px;
    }

    /* Verdict */
    .v8-verdict-profile-name {
        font-size: 24px;
    }

    .v8-verdict-section-text {
        font-size: 14px;
    }

    .v8-verdict-lever-text {
        font-size: 14px;
    }

    .v8-verdict-cta-row {
        flex-direction: column;
    }

    .v8-textarea {
        font-size: 14px;
        padding: 12px 0;
    }

    .v8-btn-send {
        font-size: 11px;
        padding: 12px 24px;
    }

    .v8-btn-book {
        font-size: 11px;
        padding: 12px 24px;
    }
}

/* --- Small mobile (< 480px) --- */
@media (max-width: 480px) {
    .v8-container {
        padding: 24px 16px 40px;
    }

    .v8-form-row {
        flex-direction: column;
        gap: var(--v8-space-lg);
    }

    .v8-question {
        font-size: 18px;
        margin-bottom: 20px;
        min-height: 36px;
    }

    .v8-option {
        font-size: 13px;
        padding: 12px 12px 12px 36px;
    }

    .v8-option .v8-option-num {
        top: 13px;
        left: 12px;
        font-size: 10px;
    }

    .v8-input {
        font-size: 16px; /* Prevent iOS auto-zoom on focus */
    }

    .v8-btn-primary {
        font-size: 11px;
        padding: 14px 24px;
    }

    .v8-btn-secondary {
        font-size: 11px;
        padding: 12px 20px;
    }

    .v8-verdict-profile-name {
        font-size: 20px;
    }

    .v8-verdict-cta-row {
        flex-direction: column;
    }

    .v8-analysis-pct {
        font-size: 30px;
    }
}

/* ============================================
   MOBILE FULLSCREEN QUIZ LOCK (< 768px)
   ============================================ */

/* Close button: hidden by default */
.v8-close-btn {
    display: none;
}

@media (max-width: 767px) {
    #diagnostic-section.v8-fullscreen {
        position: fixed;
        inset: 0;
        z-index: 9990;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #diagnostic-section.v8-fullscreen .v8-container {
        min-height: 100dvh;
        min-height: calc(var(--vh, 1vh) * 100);
        padding: 56px 22px 24px;
        align-items: center;
        justify-content: center;
    }

    /* When keyboard is open: content flows from top */
    #diagnostic-section.v8-fullscreen.v8-keyboard-open .v8-container {
        align-items: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    #diagnostic-section.v8-fullscreen.v8-keyboard-open .v8-privacy {
        display: none;
    }
}

/* Close button visible when fullscreen active (lives outside section) */
.v8-close-btn.v8-visible {
    display: flex;
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 9999;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--v8-border-light);
    border-radius: 8px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.v8-close-btn.v8-visible:active {
    background: rgba(0, 0, 0, 0.8);
}

/* Hide close button on desktop */
@media (min-width: 768px) {
    .v8-close-btn {
        display: none !important;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .v8-option,
    .v8-feedback-line,
    .v8-verdict-block,
    .v8-verdict-stage,
    .v8-main {
        transition: none !important;
    }

    .v8-waveform .bar,
    .v8-cursor,
    .v8-log-entry {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* ============================================
   HIDDEN UTILITY
   ============================================ */

#diagnostic-section.hidden {
    display: none !important;
}
