/* Reset */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --navy: #1e3a5f; --orange: #FF9800; --text: #ffffff; }

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(160deg, #0a1628 0%, #122a4a 50%, #0d1f3c 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5rem 1.2rem;
}

/* Screens */
.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Logo */
.logo { text-align: center; margin-bottom: 1.5rem; }
.logo-small img { max-width: 200px; width: 100%; height: auto; }

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

#landing-page.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

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

@keyframes ctaGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(255,107,53,0.4); }
    50% { box-shadow: 0 0 30px rgba(255,107,53,0.6), 0 0 60px rgba(255,107,53,0.2); }
}

.landing-badge {
    display: block;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #FF9800;
    margin-bottom: 10px;
    animation: fadeSlideUp 0.5s ease both;
}

.hero-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 2rem 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: fadeSlideUp 0.5s ease 0.1s both;
}

.landing-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 0.4rem;
    text-shadow: 0 0 60px rgba(255,255,255,0.06), 0 2px 4px rgba(0,0,0,0.3);
}

.landing-subtitle {
    font-size: 1.4rem;
    font-weight: 600;
    color: #FF9800;
    margin-bottom: 1.5rem;
}

/* Animated sound wave preview */
.sound-preview {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    height: 70px;
    padding: 0.5rem 0;
}

.wave-bar {
    width: 14px;
    border-radius: 7px;
    background: var(--color);
    animation: waveBar 1.2s ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0.85;
}

@keyframes waveBar {
    0%, 100% { height: 14px; }
    50% { height: 58px; }
}

.landing-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    animation: fadeSlideUp 0.5s ease 0.5s both;
}
.feature-pill {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}
.feature-pill-dot {
    color: rgba(255,255,255,0.25);
    font-size: 0.7rem;
}
.cta-icon {
    font-size: 0.8rem;
    margin-right: 0.2rem;
    vertical-align: middle;
}

/* CTA Button */
.cta-button {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 1.1rem 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0a1628;
    background: linear-gradient(135deg, #FF9800 0%, #ff8f5e 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    animation: fadeSlideUp 0.5s ease 0.35s both, ctaGlow 3s ease-in-out 1.5s infinite;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(255,107,53,0.35);
}

.cta-button:hover {
    background: #ff8555;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255,107,53,0.45);
}

.cta-button:active { transform: translateY(0); }

/* ===== QUIZ PAGE ===== */

/* Progress */
.progress-container { margin-bottom: 1.2rem; }

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #FF9800;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Audio Indicator */
.audio-indicator {
    text-align: center;
    margin: 1.5rem 0 1rem;
}

.audio-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 56px;
    margin-bottom: 0.6rem;
}

.audio-bars .bar {
    width: 7px;
    background: #FF9800;
    border-radius: 4px;
    height: 7px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

/* Bars animate when playing */
.audio-bars.playing .bar {
    opacity: 1;
}

.audio-bars.playing .bar:nth-child(1) { animation: ab1 0.7s ease-in-out infinite; }
.audio-bars.playing .bar:nth-child(2) { animation: ab2 0.55s ease-in-out infinite 0.1s; }
.audio-bars.playing .bar:nth-child(3) { animation: ab3 0.8s ease-in-out infinite 0.05s; }
.audio-bars.playing .bar:nth-child(4) { animation: ab4 0.6s ease-in-out infinite 0.15s; }
.audio-bars.playing .bar:nth-child(5) { animation: ab5 0.75s ease-in-out infinite 0.08s; }
.audio-bars.playing .bar:nth-child(6) { animation: ab6 0.65s ease-in-out infinite 0.2s; }
.audio-bars.playing .bar:nth-child(7) { animation: ab7 0.85s ease-in-out infinite 0.12s; }

@keyframes ab1 { 0%,100% { height: 7px; } 50% { height: 38px; } }
@keyframes ab2 { 0%,100% { height: 7px; } 50% { height: 50px; } }
@keyframes ab3 { 0%,100% { height: 7px; } 50% { height: 28px; } }
@keyframes ab4 { 0%,100% { height: 7px; } 50% { height: 52px; } }
@keyframes ab5 { 0%,100% { height: 7px; } 50% { height: 34px; } }
@keyframes ab6 { 0%,100% { height: 7px; } 50% { height: 44px; } }
@keyframes ab7 { 0%,100% { height: 7px; } 50% { height: 22px; } }

.audio-status {
    font-size: 1rem;
    color: #FF9800;
    font-weight: 600;
}

.autoplay-prompt {
    display: none;
    background: rgba(255,107,53,0.12);
    border: 1px solid rgba(255,107,53,0.3);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: #FF9800;
    animation: fadeIn 0.3s ease;
}

/* Question */
.question-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.2rem;
}

/* Alarm Cards (answer options) */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.alarm-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.alarm-card:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    transform: translateX(3px);
}

.alarm-card:active {
    transform: scale(0.97);
}

.alarm-card.selected {
    border-color: #FF9800;
    background: rgba(255,107,53,0.15);
    box-shadow: 0 0 20px rgba(255,107,53,0.2);
}

/* Card colour accents */
.alarm-card[data-color="red"] { border-left: 4px solid #ff4444; }
.alarm-card[data-color="orange"] { border-left: 4px solid #FF9800; }
.alarm-card[data-color="yellow"] { border-left: 4px solid #ffb300; }
.alarm-card[data-color="blue"] { border-left: 4px solid #4fc3f7; }
.alarm-card[data-color="teal"] { border-left: 4px solid #26a69a; }

.card-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
}

.card-icon-red { background: rgba(255,68,68,0.2); border: 2px solid rgba(255,68,68,0.4); }
.card-icon-orange { background: rgba(255,107,53,0.2); border: 2px solid rgba(255,107,53,0.4); }
.card-icon-yellow { background: rgba(255,179,0,0.2); border: 2px solid rgba(255,179,0,0.4); }
.card-icon-blue { background: rgba(79,195,247,0.2); border: 2px solid rgba(79,195,247,0.4); }
.card-icon-teal { background: rgba(38,166,154,0.2); border: 2px solid rgba(38,166,154,0.4); }

.card-content { flex: 1; }

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.card-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
    margin-top: 0.1rem;
}

/* Replay Button */
.replay-button {
    display: block;
    margin: 0 auto;
    padding: 0.7rem 1.3rem;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.replay-button:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* ===== RESULTS PAGE ===== */
.results-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

/* Email Gate */
.email-gate {
    background: rgba(255,107,53,0.12);
    border: 2px solid rgba(255,107,53,0.5);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 0.8rem;
}

.email-gate .hidden-score {
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255,255,255,0.15);
    letter-spacing: 0.3rem;
    margin-bottom: 0.4rem;
}

.email-gate h3 { font-size: 1.2rem; margin-bottom: 0.3rem; }

.email-gate .gate-subtext {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1rem;
}

.email-gate #newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 320px;
    margin: 0 auto;
}

.email-gate #newsletter-form input {
    padding: 0.85rem;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.email-gate #newsletter-form input::placeholder { color: rgba(255,255,255,0.4); }

.skip-link { text-align: center; margin-bottom: 1.5rem; }
.skip-link a { color: rgba(255,255,255,0.5); text-decoration: underline; font-size: 0.85rem; }
.skip-link a:hover { color: rgba(255,255,255,0.7); }

/* Report Download */
.report-download {
    background: rgba(76,175,80,0.12);
    border: 2px solid rgba(76,175,80,0.4);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.report-download .download-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: rgba(255,255,255,0.9);
}

.download-button {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0a1628;
    background: #FF9800;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

.download-button:hover {
    background: #ff8555;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

.report-download .download-subtext {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.6rem;
}

/* Score Display */
.score-display {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
}

.score-number {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.8rem;
}

.score-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.score-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.score-message {
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
}

.score-red .score-number { color: #ff4444; }
.score-red .score-bar-fill { background: #ff4444; }
.score-orange .score-number { color: #FF9800; }
.score-orange .score-bar-fill { background: #FF9800; }
.score-green .score-number { color: #4caf50; }
.score-green .score-bar-fill { background: #4caf50; }

/* Red Herring Reveal — immediate on results page */
.red-herring-reveal {
    text-align: center;
    margin: 1.5rem 0 2rem;
    padding: 1.8rem 1.2rem;
    background: rgba(255,68,68,0.08);
    border-radius: 14px;
    border: 1px solid rgba(255,68,68,0.25);
    animation: fadeSlideUp 0.6s ease 0.3s both;
}
.red-herring-hook {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ff4444;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}
.red-herring-body {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.8rem;
    line-height: 1.6;
}
.red-herring-kicker {
    font-size: 1rem;
    font-weight: 700;
    color: #FF9800;
    line-height: 1.4;
}

/* Twist (replaces old social-proof paragraph) */
.twist {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem 1rem;
    background: rgba(255,107,53,0.08);
    border-radius: 14px;
    border: 1px solid rgba(255,107,53,0.2);
}

.twist-headline {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FF9800;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.twist-body {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
}

/* Social Sharing */
.social-sharing {
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.social-sharing h3 { text-align: center; margin-bottom: 1rem; font-size: 1.1rem; }

.share-buttons { display: flex; flex-direction: column; gap: 0.6rem; }

.share-btn {
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn.facebook { background: #1877f2; color: #fff; }
.share-btn.linkedin { background: #0a66c2; color: #fff; }
.share-btn.native { background: #FF9800; color: #0a1628; }
.share-btn.copy { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

/* Explanation */
.explanation {
    background: rgba(255,255,255,0.04);
    border-left: 4px solid #FF9800;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.explanation h2 { color: #FF9800; margin-bottom: 0.8rem; font-size: 1.4rem; }
.explanation p { margin-bottom: 0.8rem; font-size: 0.95rem; line-height: 1.6; color: rgba(255,255,255,0.8); }

.insight-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.7rem 1.2rem;
    color: #FF9800;
    text-decoration: none;
    border: 2px solid #FF9800;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.insight-link:hover { background: #FF9800; color: #ffffff; }

/* Subscribe button (shared) */
.subscribe-button {
    padding: 0.9rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0a1628;
    background: #FF9800;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subscribe-button:hover { background: #ff8555; }

.reassurance-text { font-size: 0.8rem; color: rgba(255,255,255,0.35); margin-top: 0.4rem; }
.reassurance-text a { color: rgba(255,255,255,0.5); }
.form-message { margin-top: 0.6rem; font-size: 0.9rem; }
.form-message.success { color: #4caf50; }
.form-message.error { color: #ff4444; }

/* Second chance signup */
.second-chance {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.second-chance h3 { color: #fff; font-size: 1.1rem; margin-bottom: 0.3rem; }
.second-chance p { font-size: 0.95rem; color: rgba(255,255,255,0.7); margin-bottom: 1rem; }

.second-chance form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 320px;
    margin: 0 auto;
}

.second-chance input {
    padding: 0.85rem;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.second-chance input::placeholder { color: rgba(255,255,255,0.4); }

/* Mobile */
@media (max-width: 380px) {
    .container { padding: 1.2rem 1rem; }
    .landing-title { font-size: 1.8rem; }
    .landing-subtitle { font-size: 1.2rem; }
    .card-icon { width: 44px; height: 44px; font-size: 1.7rem; }
    .card-title { font-size: 0.95rem; }
    .sound-preview { gap: 8px; }
    .wave-bar { width: 11px; }
}

/* === QUIZ TOPBAR === */
.quiz-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
    min-height: 1.2rem;
}

/* === QUESTION LABEL === */
.question-label {
    font-family: 'Courier New', monospace;
    font-size: .65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
}

/* === STREAK COUNTER === */
.streak {
    font-size: .75rem;
    font-weight: 700;
    color: #FF9800;
    opacity: 0;
    transition: all .3s ease;
}
.streak.visible { opacity: 1; }
.streak.hot { color: #ff4444; animation: streakPulse .4s ease; }
@keyframes streakPulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* === CORRECT/WRONG CARD FEEDBACK === */
.alarm-card.correct {
    border-color: #4caf50 !important;
    border-left-color: #4caf50 !important;
    background: rgba(76,175,80,.15);
    animation: correctPulse .5s ease;
}
.alarm-card.wrong {
    border-color: #ff4444 !important;
    border-left-color: #ff4444 !important;
    background: rgba(255,68,68,.12);
    animation: wrongShake .4s ease;
}
.alarm-card.dimmed {
    opacity: .35;
    pointer-events: none;
}
@keyframes correctPulse {
    0% { box-shadow: 0 0 0 rgba(76,175,80,0); }
    50% { box-shadow: 0 0 20px rgba(76,175,80,.4), 0 0 40px rgba(76,175,80,.15); }
    100% { box-shadow: 0 0 0 rgba(76,175,80,0); }
}
@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* === ALARM REVEAL === */
.alarm-reveal {
    text-align: center;
    margin-top: .8rem;
    padding: .8rem 1rem;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(8px);
    transition: all .4s ease;
    display: none;
}
.alarm-reveal.visible { opacity: 1; transform: translateY(0); display: block; }
.alarm-reveal.correct {
    background: rgba(76,175,80,.08);
    border: 1px solid rgba(76,175,80,.2);
    color: #4caf50;
}
.alarm-reveal.wrong {
    background: rgba(77,200,255,.06);
    border: 1px solid rgba(77,200,255,.15);
    color: #4dc8ff;
}
.reveal-label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: .6;
    margin-bottom: .2rem;
}

/* === REACTION TIME === */
.reaction-time {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: .72rem;
    color: rgba(255,255,255,.35);
    margin-top: .4rem;
    min-height: 1rem;
    opacity: 0;
    transition: opacity .3s ease;
}
.reaction-time.visible { opacity: 1; }
.reaction-time.fast { color: #4caf50; }
.reaction-time.medium { color: #ff9800; }
.reaction-time.slow { color: #ff6b6b; }

/* === PARTICLES === */
.particle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: particleBurst .6s ease-out forwards;
}
@keyframes particleBurst {
    0% { transform: translate(0,0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* === SCORE TITLE === */
.score-title {
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: .4rem;
    opacity: .8;
}
.score-green .score-title { color: #4caf50; }
.score-orange .score-title { color: #ff9800; }
.score-red .score-title { color: #ff4444; }

/* Ensure minimum tap target size */
@media (max-width: 480px) {
    .alarm-card { min-height: 56px; }
    .cta-button, .subscribe-button, .share-btn { min-height: 48px; }
    .streak { font-size: .65rem; }
    .alarm-reveal { font-size: .88rem; padding: .6rem .8rem; }
    .reaction-time { font-size: .65rem; }
}

.gdpr-consent {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.75rem; color: rgba(255,255,255,0.4);
    cursor: pointer; text-align: left; line-height: 1.4;
}
.gdpr-consent input[type="checkbox"] {
    margin-top: 2px; flex-shrink: 0; accent-color: #FF9800;
    width: 16px; height: 16px; cursor: pointer;
}
.gdpr-consent a { color: rgba(255,255,255,0.5); text-decoration: underline; }
.gdpr-consent a:hover { color: #FF9800; }
