/* ══════════════════════════════════════════════════════════════════
   APP.CSS — FeverCare / Bác sĩ bên con
   Đã dọn dẹp: bỏ duplicate, fix mobile layout
══════════════════════════════════════════════════════════════════ */

/* ── Base ── */
html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1ID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;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ── Layout chính ── */
.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* Bỏ padding Bootstrap của article.content */
article.content {
    padding: 0 !important;
    flex: 1;
    min-width: 0;
}

main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
}

    main > article.content {
        flex: 1;
    }

/* ── Site footer ── */
.site-footer {
    margin-top: auto;
    padding: 10px 24px;
    border-top: 0.5px solid #e5e7eb;
    text-align: center;
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.site-footer-about {
    font-size: 0.73rem;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0 auto 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.site-footer-contact {
    font-size: 0.73rem;
    color: #9ca3af;
    margin: 4px 0 0;
    white-space: nowrap;
}

    .site-footer-contact a {
        color: #2563eb;
        text-decoration: none;
    }

        .site-footer-contact a:hover {
            text-decoration: underline;
        }

/* ── Language toggle ── */
.lang-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 20px;
    border: 1px solid #e0ddd6;
    background: #fff;
    font-size: 0.83rem;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

    .lang-toggle-pill:hover {
        background: #f3f4f6;
        border-color: #cbd5e1;
        color: #111827;
        text-decoration: none;
    }

.lang-flag-img {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.lang-name {
    line-height: 1;
}

/* ── Sidebar desktop ── */
.sidebar {
    background: transparent !important;
    padding: 0 !important;
    width: 220px !important;
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
    flex-shrink: 0;
}

.nav-sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px 12px;
    background: #2E7D32;
    overflow: hidden;
    box-sizing: border-box;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.15s;
    flex-shrink: 0;
}

    .nav-brand:hover {
        background: rgba(255,255,255,0.1);
    }

.nav-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.nav-brand-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f0fdf4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-brand-domain {
    font-size: 0.67rem;
    color: rgba(255,255,255,0.45);
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
    margin: 10px 0;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

    .nav-link-item i {
        font-size: 18px;
        flex-shrink: 0;
    }

    .nav-link-item:hover {
        background: rgba(255,255,255,0.1);
        color: #fff;
        text-decoration: none;
    }

    .nav-link-item.active {
        background: rgba(255,255,255,0.18);
        color: #fff;
        font-weight: 600;
    }

.nav-spacer {
    flex: 1;
    min-height: 0;
}

.nav-bottom {
    flex-shrink: 0;
    padding-bottom: 4px;
}

.nav-lang-wrap {
    padding: 6px 4px;
}

    .nav-lang-wrap .lang-toggle-pill {
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.2);
        color: rgba(255,255,255,0.85);
        width: 100%;
        justify-content: center;
    }

        .nav-lang-wrap .lang-toggle-pill:hover {
            background: rgba(255,255,255,0.18);
            color: #fff;
        }

/* ── Hamburger — ẩn desktop ── */
.nav-hamburger {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #2E7D32;
    border: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

    .nav-hamburger span {
        display: block;
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.25s, opacity 0.25s;
        transform-origin: center;
    }

    .nav-hamburger.is-open {
        opacity: 0;
        pointer-events: none;
    }

/* ── Overlay ── */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE ≤ 768px
══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Layout stack dọc */
    .page {
        flex-direction: column !important;
    }

    /* Sidebar: fixed, slide từ trái */
    .sidebar {
        position: fixed !important;
        left: -240px !important;
        top: 0 !important;
        width: 220px !important;
        height: 100% !important;
        z-index: 1050 !important;
        transition: left 0.25s ease !important;
        overflow: visible !important;
    }

        .sidebar:has(.nav-sidebar.is-open) {
            left: 0 !important;
        }

    .nav-sidebar.is-open {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 220px !important;
        height: 100% !important;
        z-index: 1050 !important;
    }

    /* Main full width, chừa chỗ hamburger */
    main {
        width: 100% !important;
        margin-left: 0 !important;
        padding-top: 64px !important;
        min-height: 100dvh;
        box-sizing: border-box;
    }

    /* article.content không có padding ngang */
    article.content {
        padding: 0 !important;
    }

    .top-row {
        display: none !important;
    }

    .nav-hamburger {
        display: flex !important;
    }

    /* Brand căn giữa trong sidebar */
    .nav-brand {
        padding-left: 0 !important;
        justify-content: center !important;
    }

    .nav-brand-name, .nav-brand-domain {
        display: block !important;
    }

    /* Footer */
    .site-footer {
        padding: 10px 12px !important;
    }

    .site-footer-about {
        white-space: normal !important;
        font-size: 0.7rem !important;
    }

    .site-footer-contact {
        white-space: normal !important;
    }

    /* ── Fever: flow-content sát 2 bên như Growth ── */
    .flow-content {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 8px 8px 0 !important;
    }

    .flow-card {
        border-radius: 16px !important;
        margin-bottom: 0 !important;
    }

        .flow-card .card-body {
            padding: 16px 12px !important;
        }

        .flow-card .flow-body {
            padding: 4px 2px !important;
        }

    /* Ẩn debug node ID */
    .mb-3.text-muted.small {
        display: none !important;
    }

    /* Fonts Fever */
    .hero-title {
        font-size: 1.4rem !important;
    }

    .hero-subtitle {
        font-size: 0.92rem !important;
    }

    .hero-desc {
        font-size: 0.83rem !important;
    }

    .question-title {
        font-size: 1.05rem !important;
        line-height: 1.5 !important;
    }

    .question-hint {
        font-size: 0.82rem !important;
    }

    /* Answer buttons */
    .answer-group {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .answer-btn {
        width: 100% !important;
        padding: 15px !important;
        font-size: 1rem !important;
        border-radius: 14px !important;
    }

    /* Reset btn */
    .reset-btn-top {
        top: 8px !important;
        right: 8px !important;
        font-size: 0.78rem !important;
        padding: 6px 10px !important;
    }

    /* Result */
    .result-success {
        padding: 14px !important;
    }

        .result-success h3 {
            font-size: 1.1rem !important;
        }

    .dose-box {
        padding: 16px !important;
        margin-top: 16px !important;
    }

        .dose-box h2 {
            font-size: 1.7rem !important;
        }

    /* Summary */
    .summary-card {
        margin-bottom: 10px !important;
    }

        .summary-card .card-body {
            padding: 10px 12px !important;
        }

    .info-grid {
        flex-direction: column !important;
        gap: 6px !important;
    }

    /* Growth */
    .growth-page {
        padding: 0 8px 40px !important;
    }

    .growth-form-card {
        padding: 16px 12px !important;
    }

    .form-row-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .sex-toggle {
        gap: 6px !important;
    }

    .sex-btn {
        padding: 8px 6px !important;
        font-size: 0.82rem !important;
    }

    .indicator-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .zscore-card {
        padding: 14px !important;
    }

    .hero-title-growth-page {
        font-size: 1.4rem !important;
    }

    .hero-subtitle-growth-page {
        font-size: 0.88rem !important;
    }

    .hero-desc-growth-page {
        font-size: 0.82rem !important;
    }

    /* Intro card Growth */
    .intro-card {
        padding: 16px 12px !important;
        border-radius: 16px !important;
    }

    .continue-btn {
        width: 100% !important;
        padding: 14px !important;
        font-size: 1rem !important;
    }

    .usage-guide {
        margin: 8px 0 !important;
    }

    .guide-content {
        font-size: 0.82rem !important;
    }

    /* Interpretation */
    .interpret-panel {
        padding: 14px !important;
    }

    .btn-interpret {
        width: 100% !important;
    }

    .acc-head {
        padding: 12px !important;
    }

    /* Unit converter */
    .uc-arrow-mid {
        display: none !important;
    }

    .uc-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        align-items: start !important;
    }

    .uc-field, .uc-result {
        width: 100% !important;
    }

    /* Home */
    .home-page {
        padding: 0 8px 40px !important;
        gap: 28px !important;
    }

    .home-hero {
        margin-top: 8px !important;
        min-height: auto !important;
    }

    .home-hero-content {
        padding: 24px 14px 20px !important;
    }

    .home-hero-title {
        font-size: 1.6rem !important;
    }

    .home-hero-subtitle {
        font-size: 0.9rem !important;
    }

    .home-hero-desc {
        font-size: 0.82rem !important;
    }

    .home-features, .home-values {
        grid-template-columns: 1fr !important;
    }

    .home-coming {
        grid-template-columns: 1fr 1fr !important;
    }

    .home-hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .home-btn-primary, .home-btn-secondary {
        justify-content: center !important;
        padding: 12px 16px !important;
    }
}

@media (max-width: 400px) {
    .home-coming {
        grid-template-columns: 1fr !important;
    }

    .info-grid {
        flex-direction: column !important;
    }
}

@media (max-width: 768px) {
    .flow-content {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 4px 4px 0 !important;
    }
}
/* Ẩn trên desktop */
.mobile-topbar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-topbar {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 8px 12px;
        height: 52px;
        /* Không fixed — scroll xuống là biến mất */
    }

    /* main không cần padding-top nhiều vì topbar nằm trong flow */
    main {
        padding-top: 0 !important;
    }

    /* Card cách topbar cố định */
    .flow-content {
        margin-top: 8px !important;
    }

    .home-page,
    .growth-page {
        margin-top: 8px !important;
    }
}
.numeric-input:focus,
.big-input:focus {
    border-color: #4a7c59 !important;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.2) !important;
    outline: none !important;
}