/*
 * MortgageReady -- Core Styles
 *
 * Design system tokens, layout, and typography.
 * Consumer-grade: clean, trustworthy, mobile-first.
 *
 * Color palette: Professional blue + warm neutrals.
 * Not the "fintech neon" look. Not the "government form" look.
 * Think: Rocket Mortgage meets Mint.
 */

/* ==================== DESIGN TOKENS ==================== */

:root {
    /* Brand */
    --brand: #1B6AC9;
    --brand-dark: #0F4C8A;
    --brand-light: #E8F1FB;
    --brand-accent: #2D9CDB;

    /* Neutrals */
    --bg: #F7F8FA;
    --bg-white: #FFFFFF;
    --text: #1A1A2E;
    --text-secondary: #5A5A72;
    --text-muted: #9696A8;
    --border: #E2E4EA;
    --border-light: #F0F1F4;

    /* Semantic */
    --success: #1AAE6F;
    --success-bg: #E6F9F0;
    --warning: #F5A623;
    --warning-bg: #FFF8EC;
    --error: #E5383B;
    --error-bg: #FDE8E8;
    --info: #2D9CDB;
    --info-bg: #E8F4FD;

    /* Typography */
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

    /* Spacing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);

    /* Layout */
    --header-height: 56px;
    --max-width: 720px;
    --max-width-wide: 960px;
}

/* ==================== RESET ==================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== HEADER ==================== */

.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
    cursor: pointer;
}

.logo:hover {
    opacity: 0.85;
}

.logo-icon {
    font-size: 20px;
}

.header-nav {
    display: flex;
    gap: 4px;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-btn.active {
    background: var(--brand-light);
    color: var(--brand);
}

/* ==================== HERO ==================== */

.hero {
    text-align: center;
    padding: 80px 24px 0;
}

.hero-inner {
    max-width: 600px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hero-trust {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== UTILITY CLASSES ==================== */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================== SECTION CONTAINERS ==================== */

.wizard,
.chat,
.report {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 24px;
}

.report {
    max-width: var(--max-width-wide);
}

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

.landing-section {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 64px 24px;
    text-align: center;
}

.landing-section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 40px;
}

/* -- How It Works (3-column steps) -- */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    text-align: center;
}

.step-card {
    padding: 32px 24px;
}

.step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    margin-bottom: 16px;
}

.step-number-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* -- What You'll Get (3x2 feature grid) -- */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: left;
}

.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-light);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--brand-light);
    color: var(--brand);
    margin-bottom: 12px;
}

.feature-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.feature-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* -- Trust signals -- */

.landing-trust {
    padding: 48px 24px;
}

.trust-bar {
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.trust-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.trust-highlight {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand);
}

/* -- Footer -- */

.landing-footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 12px;
}

.footer-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.footer-copyright {
    font-size: 12px;
    color: var(--text-muted);
}

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

@media (max-width: 640px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .header-inner {
        padding: 0 16px;
    }

    .wizard,
    .chat,
    .report {
        padding: 20px 16px;
    }

    /* Landing page mobile stacking */
    .landing-section {
        padding: 48px 16px;
    }

    .landing-section-title {
        font-size: 24px;
        margin-bottom: 28px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .step-card {
        padding: 24px 16px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .trust-bar {
        padding: 24px 16px;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== PRINT STYLES ==================== */
/* When printing from chat, hide everything except the conversation */

@media print {
    /* Hide page chrome */
    .header,
    .trust-bar,
    .chat-input-area,
    .suggestion-chips,
    .streaming-cursor {
        display: none !important;
    }

    /* Full width, no background */
    body {
        background: white !important;
    }

    .main-content,
    [id$="-mode"] {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* Chat messages: clean print layout */
    .chat-container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .chat-messages {
        max-height: none !important;
        overflow: visible !important;
    }

    .chat-message.user {
        break-inside: avoid;
    }

    .chat-message.user .chat-bubble {
        background: #F0F0F0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .chat-message.assistant .chat-bubble {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    /* Tables print cleanly */
    .chat-table-wrap {
        break-inside: avoid;
    }

    .chat-table thead {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Page header for print */
    .chat-messages::before {
        content: "MortgageReady -- Conversation Report";
        display: block;
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 16px;
        padding-bottom: 8px;
        border-bottom: 2px solid #1B6AC9;
        color: #1B6AC9;
    }
}
