:root {
    --bg: #0E1621;
    --surface: #16202E;
    --surface-2: #1D2A3C;
    --text: #E8EEF6;
    --text-hint: #8A9BB0;
    --accent: #2E9BF0;
    --accent-bright: #38BDF8;
    --primary: #2E9BF0;
    --primary-dark: #1D7FD1;
    --success: #34D399;
    --error: #F87171;
    --warning: #FBBF24;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --font: 'Roboto', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
}

#page-container {
    padding: 16px;
    padding-bottom: 80px;
}

/* ── Navbar ── */
.md-navbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: 100%;
    height: 64px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--surface);
    border-top: 1px solid rgba(232,238,246,0.08);
    z-index: 100;
    padding: 0 8px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-hint);
    cursor: pointer;
    padding: 6px 16px;
    border-radius: 12px;
    transition: color 0.2s, background 0.2s;
    font-family: var(--font);
}

.nav-btn.active {
    color: var(--accent-bright);
}

.nav-btn:active {
    background: var(--surface-2);
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* ── Tone ── */
h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 20px; font-weight: 500; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 500; color: var(--text-hint); margin-bottom: 4px; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.card-outlined {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(232,238,246,0.08);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-outlined {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 8px 16px;
}

/* ── Photo preview ── */
.photo-preview {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.photo-placeholder {
    width: 100%;
    height: 200px;
    background: var(--surface-2);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-hint);
    border: 2px dashed rgba(232,238,246,0.18);
    cursor: pointer;
}

.photo-placeholder .material-icons { font-size: 48px; }

/* ── Field ── */
.field-group {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.field-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(232,238,246,0.12);
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border 0.2s;
}

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

textarea.field-input {
    resize: vertical;
    min-height: 80px;
}

/* ── Result ── */
.result-header {
    text-align: center;
    padding: 16px 0;
}

.condition-label {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.confidence-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.conf-high { background: var(--success); color: #0E1621; }
.conf-medium { background: var(--warning); color: #0E1621; }
.conf-low { background: var(--error); color: #0E1621; }

.urgency-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.urgency-high { background: rgba(248,113,113,0.15); color: var(--error); }
.urgency-medium { background: rgba(251,191,36,0.15); color: var(--warning); }
.urgency-low { background: rgba(52,211,153,0.15); color: var(--success); }

/* ── History ── */
.history-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.history-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    margin-right: 12px;
    background: var(--surface-2);
}

.history-info { flex: 1; }

.history-label {
    font-size: 16px;
    font-weight: 500;
}

.history-date {
    font-size: 13px;
    color: var(--text-hint);
}

.history-arrow {
    color: var(--text-hint);
}

/* ── Profile / Plans ── */
.plan-card {
    border: 2px solid rgba(232,238,246,0.08);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: border 0.2s;
}

.plan-card.selected {
    border-color: var(--accent-bright);
}

.plan-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.plan-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.plan-features {
    list-style: none;
    margin-top: 8px;
}

.plan-features li {
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-hint);
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

/* ── Spinner ── */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

.spinner-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

/* ── Premium section ── */
.premium-block {
    background: linear-gradient(135deg, rgba(46,155,240,0.12), rgba(56,189,248,0.06));
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 8px;
}

/* Blur-teaser: masked preview of the locked extended report */
.blur-teaser-text {
    font-size: 13px;
    line-height: 1.5;
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

.premium-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-2);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 300;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Utility ── */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { display: flex; flex-direction: column; gap: 8px; }
.gap-12 { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }

/* ── Modal Overlay ── */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); display: flex; align-items: center;
    justify-content: center; z-index: 1000; padding: 16px;
}
.modal-card {
    background: var(--surface); border-radius: 16px;
    padding: 24px; text-align: center; max-width: 340px; width: 100%;
    box-shadow: var(--shadow-lg);
}

/* ── Promo Banner (home screen) ── */
.promo-banner {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; border-radius: var(--radius); padding: 12px 16px;
    margin-bottom: 16px;
}
.promo-banner-body {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.promo-banner-text { display: flex; flex-direction: column; gap: 2px; }
.promo-banner-btn {
    background: rgba(255,255,255,0.2); border: none; color: #fff;
    border-radius: 8px; padding: 4px; cursor: pointer; line-height: 0;
}
.promo-banner-btn:active { background: rgba(255,255,255,0.35); }

/* ── Home hero ── */
.hero { text-align: center; padding: 24px 0 16px; }
.hero-logo { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-bright); font-weight: 700; }
.hero-title { font-size: 26px; line-height: 1.25; margin-top: 10px; margin-bottom: 0; }
.hero-sub { color: var(--text-hint); margin-top: 8px; font-size: 14px; }

.symptoms-toggle { color: var(--accent); font-size: 14px; margin-top: 12px; cursor: pointer; text-align: center; padding: 8px 0; }

.analyze-btn { position: sticky; bottom: 16px; }

.photo-placeholder { min-height: 45vh; height: auto; }

/* ── Single-analysis promo card on home ── */
.single-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(46,155,240,0.14), rgba(56,189,248,0.05));
    border: 1px solid rgba(46,155,240,0.35);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.single-promo:active {
    background: linear-gradient(135deg, rgba(46,155,240,0.22), rgba(56,189,248,0.09));
}
.single-promo-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.single-promo-icon {
    font-size: 22px;
    color: var(--accent-bright);
    background: rgba(46,155,240,0.16);
    border-radius: 12px;
    padding: 8px;
}
.single-promo-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.single-promo-sub {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 2px;
}
.single-promo-arrow {
    color: var(--text-hint);
    font-size: 22px;
}

/* ── VPN hint under YooKassa buttons ── */
.vpn-hint {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 8px;
    line-height: 1.45;
}
