:root {
    --navy: #0D2137;
    --navy-mid: #1A3C5E;
    --coral: #E8522A;
    --coral-light: #FFF0EB;
    --coral-hover: #D4461F;
    --teal: #0BA39D;
    --teal-light: #E0F5F4;
    --gold: #F5A623;
    --bg: #F7F4F0;
    --white: #FFFFFF;
    --text: #111827;
    --muted: #64748B;
    --border: #E2DDD6;
    --border-light: #F0ECE6;
    --green: #16A34A;
}

.lang-selector {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.lang-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.lang-btn:hover {
    border-color: var(--coral);
    background: var(--coral-light);
    color: var(--coral);
}
.lang-btn.active {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

h1, h2, h3, .serif {
    font-family: 'Fraunces', serif;
}

.screen {
    display: none;
    min-height: 100vh;
    animation: fadeUp 0.6s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Landing --- */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-badge {
    background: var(--coral-light);
    color: var(--coral);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    max-width: 800px;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin-bottom: 40px;
}

/* --- Buttons --- */
.btn-primary {
    background: var(--coral);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--coral-hover);
    transform: translateY(-2px);
}

.btn-ai {
    background: linear-gradient(135deg, var(--teal), #087A74);
    color: white;
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    cursor: pointer;
}

/* --- Chat IA --- */
.chat-window {
    max-width: 600px;
    margin: 20px auto;
    background: white;
    border-radius: 24px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.6;
    font-size: 15px;
}

.ai-bubble {
    background: var(--white);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.user-bubble {
    background: var(--coral);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 12px;
    outline: none;
    font-size: 16px;
}

/* --- Result Card --- */
.result-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.result-card.featured {
    border: 2px solid var(--coral);
    box-shadow: 0 10px 30px rgba(232,82,42,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.insurer-pill {
    background: var(--navy);
    color: white;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.score-ring-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.price-tag {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--navy);
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.mini-bar-container {
    margin-bottom: 8px;
}

.mini-bar-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    display: flex;
    justify-content: space-between;
}

.bar-bg {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin-top: 4px;
}

.bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--teal);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 20px;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: var(--border-light);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-close:hover { background: var(--border); }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; width: 100%; padding: 0 20px; }

.executive-summary-card {
    background: linear-gradient(135deg, #1A3C5E 0%, #0D2137 100%);
    color: white;
    padding: 40px;
    border-radius: 28px;
    margin-bottom: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    width: 100%;
}

.pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.pill-item {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px;
    background: #F1F5F9;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-light);
}

.red-pill { background: #F0FDF4; color: #166534; border-color: #DCFCE7; }
.wait-pill { background: #EFF6FF; color: #1E40AF; border-color: #DBEAFE; }
.price-pill { background: #FEF2F2; color: #991B1B; border-color: #FEE2E2; }
.future-pill { background: #F5F3FF; color: #5B21B6; border-color: #EDE9FE; }
.refund-pill { background: #ECFEFF; color: #0891B2; border-color: #CFFAFE; }
.health-pill { background: #FFF7ED; color: #C2410C; border-color: #FFEDD5; }

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- Mobile Responsive --- */
@media (max-width: 600px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    .pros-cons-grid {
        grid-template-columns: 1fr !important;
    }
    .hero h1 {
        font-size: 32px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .price-action-container {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .chat-window {
        height: 85vh;
        margin: 10px;
        border-radius: 12px;
    }
    .result-card {
        padding: 16px;
    }
}
/* --- Executive Summary Styling --- */
.executive-summary-card {
    background: linear-gradient(145deg, var(--navy) 0%, #1a2e44 100%);
    color: white;
    padding: 35px;
    border-radius: 28px;
    margin-bottom: 45px;
    box-shadow: 0 25px 50px -12px rgba(13, 33, 55, 0.5);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

.executive-summary-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(232,82,42,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.summary-header h3 {
    font-size: 22px;
    margin: 0;
    color: white;
    letter-spacing: -0.5px;
}

.summary-body {
    font-size: 15px;
    line-height: 1.8;
    color: #e2e8f0;
}

.summary-body strong {
    color: var(--gold);
    font-weight: 800;
}

.summary-body p {
    margin-bottom: 15px;
}

.summary-body ul {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

.summary-body li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 14px;
}

.summary-body li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--coral);
    font-weight: 900;
}
/* --- Copay Badges --- */
.copay-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.no-copay {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.has-copay {
    background: #FFEDD5;
    color: #9A3412;
    border: 1px solid #FED7AA;
}

/* --- Mobile Improvements --- */
@media (max-width: 600px) {
    .card-main-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }
    .container-narrow {
        padding: 20px 10px;
    }
    .executive-summary-card {
        padding: 20px;
    }
    .hero h1 {
        font-size: 28px;
    }
    .btn-entrance {
        padding: 15px;
    }
}
.loading-step {
    padding: 10px 0;
    font-size: 14px;
    color: var(--muted);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.loading-step.active {
    color: var(--navy);
    font-weight: 700;
}
.loading-step.active::before {
    content: '●';
    color: var(--coral);
    animation: pulse 1s infinite alternate;
}
.loading-step.done {
    color: var(--green);
}
.loading-step.done::before {
    content: '✓';
    font-weight: 900;
}
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }
/* --- Autocomplete --- */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: none;
}
.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}
.autocomplete-item:hover {
    background: #f8fafc;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item strong {
    color: var(--navy);
    display: block;
}
/* --- Final UI Tweaks --- */
.results-container { width: 100%; max-width: 1200px; }
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 13px;
    background: white;
    border-radius: 12px;
    overflow-x: auto;
    display: table;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.comparison-table th, .comparison-table td {
    padding: 15px;
    border: 1px solid var(--border-light);
    text-align: left;
}
.comparison-table th {
    background: #F8FAFC;
    color: var(--navy);
    font-weight: 800;
}
}

/* --- Premium Pills --- */
.pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}
.pill-item {
    font-size: 11px;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.pill-item:hover { transform: translateY(-1px); }
.pill-icon { font-size: 14px; }

.red-pill { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.wait-pill { background: #FFF7ED; color: #C2410C; border-color: #FFEDD5; }
.price-pill { background: #ECFDF5; color: #047857; border-color: #D1FAE5; }
.future-pill { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }
.refund-pill { background: #F0F9FF; color: #0369A1; border-color: #BAE6FD; }
.health-pill { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }

/* Custom Scrollbar for details */
.modal-content::-webkit-scrollbar { width: 8px; }
.modal-content::-webkit-scrollbar-track { background: #f1f1f1; }
.modal-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: #999; }
