/* ==========================================================================
   NPG AI OMR SCANNER - MODERN MOBILE PWA STYLESHEET
   Glassmorphism UI, Responsive Viewfinder, Real-Time HUD & Bottom Sheets
   ========================================================================== */

:root {
    --bg-primary: #090d16;
    --bg-surface: #111827;
    --bg-glass: rgba(17, 24, 39, 0.88);
    --bg-glass-light: rgba(30, 41, 59, 0.75);
    --border-glass: rgba(255, 255, 255, 0.12);
    --accent-cyan: #00f3ff;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #ef4444;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;
    --safe-top: env(safe-area-inset-top, 12px);
    --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
    position: fixed;
}

/* App Shell */
.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   VIEWFINDER & VIDEO OVERLAY
   -------------------------------------------------------------------------- */
.viewfinder-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Reticle Target Guide Box (Visual Guide for Teacher) */
.reticle-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88vw;
    height: calc(88vw * 0.70); /* Matches canonical 1000:700 aspect ratio */
    max-width: 540px;
    max-height: 380px;
    border: 2px dashed rgba(0, 243, 255, 0.45);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 6;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.reticle-guide.locked {
    border: 3px solid var(--accent-emerald);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.5), 0 0 0 9999px rgba(0, 0, 0, 0.65);
    animation: lockPulse 1.2s infinite alternate;
}

@keyframes lockPulse {
    from { border-color: #10b981; }
    to { border-color: #34d399; }
}

/* Laser Scanner Line Effect */
.reticle-guide .scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    box-shadow: 0 0 12px var(--accent-cyan);
    animation: scanSweep 2.4s ease-in-out infinite alternate;
}

@keyframes scanSweep {
    0% { top: 0%; opacity: 0.2; }
    50% { opacity: 0.9; }
    100% { top: 100%; opacity: 0.2; }
}

/* Corner Reticle Brackets */
.corner-bracket {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid var(--accent-cyan);
}
.corner-bracket.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.corner-bracket.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.corner-bracket.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.corner-bracket.br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

/* --------------------------------------------------------------------------
   TOP HUD BAR
   -------------------------------------------------------------------------- */
.top-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: calc(var(--safe-top) + 8px) 16px 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(9, 13, 22, 0.92) 0%, rgba(9, 13, 22, 0.4) 75%, transparent 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #0284c7, #00f3ff);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 243, 255, 0.35);
}

.brand-text {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
}
.brand-text span {
    color: var(--accent-cyan);
}

.ai-badge {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
    animation: aiPulse 2.5s infinite alternate;
}

@keyframes aiPulse {
    from { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 4px rgba(16, 185, 129, 0.2); }
    to { border-color: rgba(0, 243, 255, 0.7); box-shadow: 0 0 10px rgba(0, 243, 255, 0.4); }
}

.hud-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
}

.hud-btn:active {
    transform: scale(0.92);
}

.hud-btn.active {
    background: var(--accent-amber);
    color: #000;
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* Status Pill */
.status-pill-wrap {
    position: absolute;
    top: calc(var(--safe-top) + 60px);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 18;
    pointer-events: none;
}

.status-pill {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.status-pill .indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-amber);
    box-shadow: 0 0 8px var(--accent-amber);
    animation: blinkDot 1.5s infinite;
}

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

.status-pill.locked {
    border-color: var(--accent-emerald);
    color: #4ade80;
    background: rgba(6, 78, 59, 0.85);
}
.status-pill.locked .indicator-dot {
    background: var(--accent-emerald);
    box-shadow: 0 0 10px #34d399;
}

/* Active Key Tag */
.active-key-pill {
    position: absolute;
    top: calc(var(--safe-top) + 98px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 18;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(59, 130, 246, 0.4);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 0.74rem;
    color: #93c5fd;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.active-key-pill i {
    font-size: 0.70rem;
    color: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   BOTTOM CONTROL BAR
   -------------------------------------------------------------------------- */
.bottom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 12px 24px calc(var(--safe-bottom) + 12px) 24px;
    background: linear-gradient(0deg, rgba(9, 13, 22, 0.96) 0%, rgba(9, 13, 22, 0.75) 70%, transparent 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ctrl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn .icon-box {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--text-primary);
    position: relative;
    transition: all 0.2s ease;
}

.ctrl-btn:active .icon-box {
    transform: scale(0.92);
    border-color: var(--accent-cyan);
}

.ctrl-btn .badge-count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--accent-rose);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-primary);
}

/* Shutter Trigger Button */
.shutter-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid rgba(255, 255, 255, 0.85);
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
    outline: none;
}

.shutter-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f3ff, #0284c7);
    box-shadow: 0 0 16px rgba(0, 243, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    transition: all 0.15s ease;
}

.shutter-btn:active {
    transform: scale(0.90);
}
.shutter-btn:active .shutter-inner {
    background: #10b981;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.8);
}

/* --------------------------------------------------------------------------
   MODALS & BOTTOM SHEETS
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-glass);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    padding-bottom: var(--safe-bottom);
}

.modal-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-handle-bar {
    width: 100%;
    padding: 10px 0 6px 0;
    display: flex;
    justify-content: center;
    cursor: grab;
}

.sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
}

.sheet-header {
    padding: 10px 20px 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
}

.sheet-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-glass-light);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
}

.sheet-body {
    padding: 16px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* --------------------------------------------------------------------------
   STUDENT SCORECARD DETAILS (INSTANT SCAN RESULT)
   -------------------------------------------------------------------------- */
.score-card-hero {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(0, 243, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.roll-badge-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.roll-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.roll-val-edit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.roll-val {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    font-family: monospace;
}

.score-display {
    text-align: right;
}

.score-val {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}
.score-val span {
    font-size: 1.05rem;
    color: var(--text-muted);
}

.grade-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 800;
    background: var(--accent-emerald);
    color: #000;
    margin-top: 4px;
}

/* Metrics 3-Col Bar */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.metric-box {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.metric-box .m-count {
    font-size: 1.3rem;
    font-weight: 800;
}
.metric-box.correct .m-count { color: var(--accent-emerald); }
.metric-box.wrong .m-count { color: var(--accent-rose); }
.metric-box.skipped .m-count { color: var(--text-muted); }

.metric-box .m-label {
    font-size: 0.70rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 2px;
}

/* Breakdown Grid */
.breakdown-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    margin-bottom: 16px;
}

.breakdown-cell {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 6px;
    padding: 5px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid transparent;
}
.breakdown-cell.c-correct { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.12); }
.breakdown-cell.c-wrong { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.12); }
.breakdown-cell.c-skipped { border-color: rgba(148, 163, 184, 0.2); }

.b-qnum { font-size: 0.64rem; color: var(--text-muted); font-weight: 700; }
.b-ans { font-size: 0.85rem; font-weight: 800; color: #fff; }
.breakdown-cell.c-correct .b-ans { color: #34d399; }
.breakdown-cell.c-wrong .b-ans { color: #f87171; text-decoration: line-through; }
.b-key { font-size: 0.62rem; color: var(--accent-cyan); font-weight: 700; }

/* Result Action Buttons */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-action-lg {
    width: 100%;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-action-lg:active {
    transform: scale(0.98);
}

.btn-whatsapp {
    background: #25d366;
    color: #000;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
}

.btn-save-next {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

/* --------------------------------------------------------------------------
   ANSWER KEY MODAL & BATCH MODAL
   -------------------------------------------------------------------------- */
.tab-row {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.tab-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.80rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--bg-surface);
    color: var(--accent-cyan);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.key-input-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 2px;
}

.key-q-cell {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.key-q-num {
    font-size: 0.70rem;
    font-weight: 700;
    color: var(--text-muted);
}

.key-options-row {
    display: flex;
    gap: 2px;
}

.key-opt-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-opt-btn.selected {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    font-weight: 900;
}

/* Batch Table */
.batch-table-wrap {
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.batch-table th {
    background: #1e293b;
    padding: 10px 8px;
    color: var(--text-secondary);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

.batch-table td {
    padding: 8px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 90px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 8px 18px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s ease forwards;
}

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

/* --------------------------------------------------------------------------
   STEP NAVIGATION & STEP 1 EXAM / ANSWER KEY SETUP
   -------------------------------------------------------------------------- */
.step-nav-bar {
    width: 100%;
    height: 52px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    z-index: 40;
    position: relative;
    padding-top: calc(var(--safe-top) * 0.5);
    flex-shrink: 0;
}

.step-tab {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    transition: all 0.25s ease;
}

.step-tab.active {
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.05);
}

.step-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 3px;
    background: var(--accent-cyan);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.step-view {
    width: 100%;
    height: calc(100% - 52px);
    position: relative;
}

#step1View {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 18px 40px 18px;
    background: var(--bg-primary);
}

.setup-container {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.setup-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.setup-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setup-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.setup-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setup-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.setup-input, .setup-select {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 9px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}

.setup-input:focus, .setup-select:focus {
    border-color: var(--accent-cyan);
}

/* Method Selector Tabs in Step 1 */
.method-tabs {
    display: flex;
    gap: 6px;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.method-tab-btn {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.method-tab-btn.active {
    background: var(--bg-surface);
    color: var(--accent-cyan);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 50-Q Step 1 Matrix */
.step1-matrix-wrap {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 2px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.25);
}

.step1-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
    padding: 6px;
}

.matrix-card-item {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 6px 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.matrix-q-title {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-muted);
}

.matrix-opt-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.m-opt-btn {
    width: 100%;
    height: 19px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.m-opt-btn:active {
    transform: scale(0.95);
}

.m-opt-btn.selected {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    font-weight: 900;
    box-shadow: 0 0 6px rgba(0, 243, 255, 0.5);
}

/* Quick Fill Buttons Bar */
.matrix-quick-presets {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-preset {
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-preset:active { background: rgba(255,255,255,0.15); }

/* Big Primary Proceed CTA */
.btn-proceed-cta {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-proceed-cta:active {
    transform: scale(0.98);
}

/* Step 2 Back to Key Button in HUD */
.hud-btn-back-step {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(12px);
}
.hud-btn-back-step:active { transform: scale(0.95); }

