/* ============================================
   PASSCTRL.AI — AI HEALTH CHECK INTAKE
   Ultra-minimal monochrome — LIGHT THEME
   White bg, black text, PassCtrlAI brand
   ============================================ */

:root {
    --white: #FFFFFF;
    --black: #000000;
    --bg: #FFFFFF;
    --surface: #F5F5F5;
    --surface-2: #EBEBEB;
    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.18);
    --text: #000000;
    --text-muted: rgba(0,0,0,0.5);
    --text-dim: rgba(0,0,0,0.35);
    --accent: #000000;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --node-color: 0, 0, 0;
}

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

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* ---- Typography ---- */
.mono-text { font-family: var(--font-mono); letter-spacing: 0.05em; }
.dim { color: var(--text-dim); }
.success { color: var(--text); }
.small { font-size: 11px; }

/* ---- Screens ---- */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s var(--ease-out), visibility 0.6s;
    z-index: 1;
    background: var(--bg);
}
.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* ============================================
   BACKGROUND ANIMATION CANVAS
   ============================================ */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   BOOT SEQUENCE
   ============================================ */
.boot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.logo-mark {
    opacity: 0;
    animation: fadeIn 0.5s var(--ease-out) 0.2s forwards;
}

.logo-mark svg rect,
.logo-mark svg path,
.logo-mark svg circle {
    stroke: var(--text);
}

.boot-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    text-align: left;
    min-width: 320px;
}

.boot-line {
    opacity: 0;
    transform: translateY(8px);
    display: flex;
    align-items: center;
    gap: 4px;
}

.boot-line.visible {
    animation: bootLineIn 0.4s var(--ease-out) forwards;
}

.loading-dots::after {
    content: '';
    animation: dots 1.2s steps(3) infinite;
}

.boot-progress {
    width: 320px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.5s var(--ease-out) 0.4s forwards;
}

.boot-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--text);
    border-radius: 1px;
    animation: bootProgress 2.2s var(--ease-out) 0.6s forwards;
}

/* ============================================
   WELCOME / HERO
   ============================================ */
.welcome-container {
    max-width: 680px;
    width: 100%;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.welcome-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 64px;
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--text);
}
.logo-text.small { font-size: 12px; letter-spacing: 0.15em; }
.logo-dot { opacity: 0.35; }

.welcome-content {
    margin-bottom: 48px;
}

.section-label {
    font-size: 11px;
    letter-spacing: 0.15em;
    margin-bottom: 20px;
}

.welcome-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.welcome-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 32px;
}

.welcome-pillars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 40px;
}

.pillar-chip {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    transition: border-color 0.3s, color 0.3s;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
}
.pillar-chip:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.welcome-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.meta-label {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.meta-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--black);
    color: var(--white);
    border: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.cta-button:active {
    transform: translateY(0);
}

.cta-button svg {
    stroke: var(--white);
}

/* ============================================
   QUESTION SCREEN
   ============================================ */
.question-container {
    max-width: 720px;
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.question-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11px;
}

/* Progress track */
.progress-track {
    height: 2px;
    background: var(--surface);
    position: relative;
    margin-bottom: 48px;
    flex-shrink: 0;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--text);
    transition: width 0.5s var(--ease-out);
    width: 0%;
}

.progress-segments {
    position: absolute;
    inset: 0;
    display: flex;
}

.segment {
    flex: 1;
    border-right: 1px solid var(--bg);
}
.segment:last-child { border-right: none; }

/* Question body */
.question-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    padding: 8px 0;
}

.question-pillar-icon {
    margin-bottom: 16px;
    opacity: 0.25;
    font-size: 18px;
}

.question-text {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    animation: questionIn 0.4s var(--ease-out);
}

.question-context {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 32px;
    max-width: 520px;
    animation: questionIn 0.4s var(--ease-out) 0.05s both;
}

/* Answer grid */
.answer-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: questionIn 0.4s var(--ease-out) 0.1s both;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.answer-option:hover {
    border-color: var(--border-hover);
    background: var(--surface);
}

.answer-option.selected {
    border-color: rgba(0,0,0,0.3);
    background: var(--surface);
}

.answer-option.selected .answer-key {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.answer-key {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: all 0.2s;
}

.answer-label {
    font-size: 15px;
    line-height: 1.4;
    color: var(--text);
}

/* Bottom nav */
.question-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s;
}
.nav-back:hover { color: var(--text); }
.nav-back:disabled { opacity: 0.2; cursor: default; }

.nav-back svg { stroke: currentColor; }

.keyboard-hint {
    font-size: 11px;
}

/* Pillar visualization (ambient) — now overlays behind question */
.pillar-viz {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

#viz-canvas {
    width: 100%;
    height: 100%;
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-container {
    max-width: 600px;
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.contact-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-title {
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.contact-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 36px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}

.form-input {
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

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

.form-input:focus {
    border-color: rgba(0,0,0,0.3);
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5l3 3 3-3' stroke='rgba(0,0,0,0.35)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: var(--bg);
    padding-right: 36px;
}

.form-select option {
    background: var(--bg);
    color: var(--text);
}

/* ============================================
   PROCESSING SCREEN
   ============================================ */
.processing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.processing-visual {
    width: 200px;
    height: 200px;
    position: relative;
}

#processing-canvas {
    width: 100%;
    height: 100%;
}

.processing-title {
    font-size: 24px;
    font-weight: 500;
    margin-top: 8px;
    margin-bottom: 24px;
}

.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.process-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-dim);
    transition: color 0.3s;
}

.process-step.active {
    color: var(--text);
}

.process-step.done {
    color: var(--text-muted);
}

.step-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: all 0.3s;
}

.process-step.active .step-indicator {
    background: var(--text);
    box-shadow: 0 0 12px rgba(0,0,0,0.15);
    animation: pulse 1.5s ease infinite;
}

.process-step.done .step-indicator {
    background: var(--text-muted);
}

/* ============================================
   CONFIRMATION SCREEN
   ============================================ */
.confirm-container {
    max-width: 560px;
    width: 100%;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.confirm-check {
    margin-bottom: 24px;
    animation: scaleIn 0.5s var(--ease-spring);
}

.confirm-check svg circle,
.confirm-check svg path {
    stroke: var(--text);
}

.confirm-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
}

.confirm-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 40px;
}

.confirm-preview {
    width: 100%;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 32px;
}

.preview-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    margin-bottom: 20px;
    color: var(--text-dim);
}

.preview-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.preview-score-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.preview-score-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.preview-score-bar {
    height: 3px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
}

.preview-score-fill {
    height: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: width 1s var(--ease-out);
}

.preview-score-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 500;
}

.confirm-footer {
    margin-top: 8px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bootLineIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bootProgress {
    from { width: 0%; }
    to { width: 100%; }
}

@keyframes dots {
    0% { content: ''; }
    33% { content: '.'; }
    66% { content: '..'; }
    100% { content: '...'; }
}

@keyframes questionIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .welcome-meta {
        gap: 16px;
    }
    .preview-scores {
        grid-template-columns: repeat(2, 1fr);
    }
    .keyboard-hint {
        display: none;
    }
    .question-body {
        padding: 4px 0;
    }
    .progress-track {
        margin-bottom: 24px;
    }
    .question-text {
        font-size: 20px;
    }
    .answer-option {
        padding: 14px 16px;
    }
}

@media (max-width: 380px) {
    .preview-scores {
        grid-template-columns: 1fr;
    }
    .welcome-pillars {
        gap: 6px;
    }
    .pillar-chip {
        font-size: 10px;
        padding: 5px 10px;
    }
}

/* ============================================
   EMBED MODE
   When loaded inside an iframe, body gets
   .embed-mode class for tighter spacing
   ============================================ */
body.embed-mode .welcome-header {
    margin-bottom: 40px;
}
body.embed-mode .welcome-container {
    padding: 32px 24px;
}
