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

:root {
    /* Cosmic Terminal Palette */
    --bg: #050505;
    /* Deepest Black */
    --surface: #111111;
    /* Component Background */
    --surface-hover: #1a1a1a;

    --text: #ffffff;
    --text-muted: #999999;
    --text-dim: #444444;

    --border: #222222;
    --border-hover: #444444;

    /* The 'Antigravity' Pop */
    --accent: #4030E0;
    /* Electric Cobalt */
    --accent-hover: #5340FF;
    /* Brighter Cobalt */
    --accent-glow: rgba(83, 64, 255, 0.4);

    --radius: 4px;
    /* Sharp, technical feel */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 48px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- LAYOUT UTILITIES --- */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 24px 60px;
}

.content-wrapper {
    width: 100%;
    max-width: 40rem;
    /* Tighter focus for the entry */
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3 {
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--text);
}

.step-layout h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* --- INPUTS & FORMS (The Flight Plan) --- */
.input-field {
    width: 100%;
    margin-bottom: 24px;
    /* Consistent stacking */
    margin-top: 0 !important;
    /* Override inline styles */
}

.input-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Base Input Style */
.input-field input[type="text"],
.input-field input[type="time"],
.usa-date-of-birth input,
.usa-date-of-birth select {
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    /* Data look */
    font-size: 1.5rem;
    font-weight: 400;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

/* Date input styling */
.input-field input[type="date"] {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    font-weight: 400;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
    cursor: pointer;
}

.input-field input[type="date"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
    background: #151520;
}

/* Style the date picker calendar icon */
.input-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
    opacity: 0.7;
}

.input-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.date-confirmation {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    min-height: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
}

.date-confirmation.error {
    color: #ff6b6b;
}

.date-confirmation.empty {
    color: transparent;
}

/* Focus State: Cobalt Glow */
.input-field input:focus,
.usa-date-of-birth input:focus,
.usa-date-of-birth select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
    background: #151520;
    /* Slight tint on focus */
}

.usa-date-of-birth input::placeholder {
    color: #333;
}

/* --- BUTTONS (Propulsion) --- */
.primary-btn {
    display: block;
    width: 100%;
    padding: 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(64, 48, 224, 0.3);
    /* Cobalt Shadow */
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(83, 64, 255, 0.5);
}

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

.primary-btn:disabled {
    background: var(--surface);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* --- LOADING SCREEN (Twinkling Stars) --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.loading-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star {
    position: absolute;
    background: var(--text);
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 2s infinite ease-in-out;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 10px rgba(64, 48, 224, 0.5), 0 0 20px rgba(64, 48, 224, 0.3);
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.loading-text-container {
    position: relative;
    z-index: 10;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    box-shadow: none;
}

.loading-text {
    color: var(--text);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    margin: 0;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* --- PAYMENT GATE --- */
.payment-gate-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    z-index: 99998;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.payment-gate-card {
    width: 100%;
    max-width: 42rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    animation: fade-in-up 0.6s ease-out;
}

.payment-option {
    width: 100%;
}

/* --- HOOK CARD (The Signal) --- */
.hook-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.hook-card {
    width: 100%;
    max-width: 42rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fade-in-up 0.6s ease-out;
}

.hook-domain {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    /* Cobalt Label */
}

.hook-heading {
    font-size: 2.25rem;
    line-height: 1.2;
    color: var(--text);
}

.hook-body {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-muted);
    font-weight: 300;
}

.hook-body p,
.hook-body-positive {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-weight: 300;
}

.hook-body p:last-child,
.hook-body-negative {
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 0;
}

/* --- SELECTION SCREEN (The Flight Paths) --- */
.reading-selection-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    z-index: 99999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reading-selection-content {
    width: 100%;
    max-width: 1400px;
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
}

.selection-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 600px;
}

.selection-header h1 {
    font-size: 2.5rem;
    color: var(--text);
}

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

/* Podium Layout */
.reading-cards-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 60px;
    padding: 20px;
    flex-wrap: wrap;
    /* Fallback for mobile */
}

.reading-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    min-height: 340px;
    position: relative;
    width: 300px;
    /* Fixed base width */
}

/* Side Cards (Variations) */
.card-side {
    transform: scale(0.95) translateY(20px);
    opacity: 0.8;
    border-color: var(--border);
}

.card-side:hover {
    transform: scale(1) translateY(10px);
    opacity: 1;
    border-color: var(--text-dim);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Center Card (The Truth?) */
.card-center {
    transform: scale(1.05) translateY(-10px);
    /* Lifted */
    z-index: 10;
    border-color: var(--accent);
    /* Cobalt by default */
    box-shadow: 0 0 30px rgba(64, 48, 224, 0.15);
    min-height: 380px;
    /* Physically taller */
}

.card-center:hover {
    transform: scale(1.08) translateY(-15px);
    box-shadow: 0 0 50px rgba(64, 48, 224, 0.3);
}

.card-center .reading-meta {
    background: var(--accent);
    color: white;
}

.reading-card-header {
    display: flex;
    justify-content: center;
    /* Center labels */
    align-items: center;
    margin-bottom: 24px;
}

.reading-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.reading-meta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    /* Cobalt Tag */
    background: rgba(64, 48, 224, 0.1);
    padding: 6px 10px;
    border-radius: 2px;
}

.reading-card-body {
    flex-grow: 1;
    margin-bottom: 32px;
}

.reading-preview-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-weight: 300;
    /* Fade out */
    mask-image: linear-gradient(180deg, #000 60%, transparent);
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
}

.view-reading-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: var(--radius);
}

.reading-card:hover .view-reading-btn {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.selection-footer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: auto;
}

/* --- FULL READING VIEW (Deep Reader) --- */
.reading-full-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    z-index: 100000;
    display: flex;
    flex-direction: column;
}

.reading-nav {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
}

.back-link {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.back-link:hover {
    color: var(--text);
}

.reading-meta-tag {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--accent);
}

/* --- UTILITIES & SUB-COMPONENTS --- */
button,
input,
textarea,
select {
    font-family: inherit;
    /* Ensure fonts match body */
}

.btn-secondary,
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover,
.btn-outline:hover {
    border-color: var(--text);
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.email-capture-container {
    margin-top: 60px;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 40px;
    margin-bottom: 40px;
}

.email-form-group {
    display: flex;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.email-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 16px;
    color: var(--text);
    border-radius: var(--radius);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.email-input:focus {
    border-color: var(--accent);
}

.email-message {
    margin-top: 12px;
    font-size: 0.875rem;
    min-height: 20px;
}

.reading-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 60px 20px 140px;
    display: flex;
    justify-content: center;
}

.reading-paper {
    width: 100%;
    max-width: 65ch;
}

.reading-paper p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #e0e0e0;
    /* Slightly softened white for long reading */
    margin-bottom: 28px;
    font-weight: 300;
}

/* Target ONLY the first paragraph of the actual reading content */
.reading-text>p:first-of-type::first-letter {
    font-size: 3.5rem;
    line-height: 0.8;
    float: left;
    margin-right: 16px;
    font-weight: 700;
    color: var(--accent);
    /* Cobalt Drop Cap */
}

/* .reading-global-actions removed */

.select-reading-btn-final {
    pointer-events: auto;
    padding: 18px 48px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 24px rgba(64, 48, 224, 0.4);
}

.select-reading-btn-final:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(83, 64, 255, 0.6);
}

/* --- FOOTER (Hidden in app view usually) --- */
footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
}

footer a {
    color: var(--text-muted) !important;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--text) !important;
}

/* --- ANIMATIONS --- */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVENESS --- */
@media (max-width: 768px) {
    .main-content {
        padding: 0 20px 80px;
    }

    .step-layout h1 {
        font-size: 2rem;
    }

    .usa-date-of-birth {
        gap: 8px;
    }

    .usa-date-of-birth input,
    .input-field input[type="text"],
    .input-field input[type="time"] {
        font-size: 1.25rem;
        padding: 12px;
    }

    .hook-card {
        padding: 32px 20px;
    }

    .hook-heading {
        font-size: 1.75rem;
    }

    .reading-selection-content {
        padding: 40px 16px;
    }

    .selection-header h1 {
        font-size: 2rem;
    }

    .reading-cards-grid {
        grid-template-columns: 1fr;
    }

    .reading-paper p {
        font-size: 1.1rem;
    }

    .reading-nav {
        padding: 0 20px;
    }
}

/* --- EMAIL RESCUE (The Patient Option) --- */
.email-rescue-container {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    max-width: 320px;
    width: 100%;
}

.email-rescue-container.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.rescue-label {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    font-weight: 700;
    text-transform: uppercase;
}

.rescue-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.rescue-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
}

.rescue-input:focus {
    border-color: var(--accent);
}

.rescue-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0 16px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.rescue-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* --- INSIGHTS VIEW (Production) --- */
.insights-container {
    white-space: pre-wrap;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e0e0e0;
    margin-top: 2rem;
    font-weight: 300;
}

/* --- LOADING OVERLAY --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner-container {
    text-align: center;
    color: var(--text);
}

.cosmic-spinner {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(83, 64, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: rotate 1s infinite linear, pulse-glow 2s infinite ease-in-out;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 30px var(--accent-glow);
    }
}