/* ===== Variables ===== */
:root {
    --primary:       #2563EB;
    --primary-dark:  #1d4ed8;
    --secondary:     #EAF2FF;
    --bg:            #F8FAFC;
    --white:         #ffffff;
    --text-dark:     #1e293b;
    --text-mid:      #475569;
    --text-light:    #94a3b8;
    --border:        #e2e8f0;
    --shadow:        0 4px 24px rgba(37, 99, 235, 0.07);
    --radius:        12px;
    --radius-lg:     20px;

    /* Category colors */
    --c-excellent:   #16a34a;
    --c-good:        #65a30d;
    --c-moderate:    #d97706;
    --c-risky:       #ea580c;
    --c-very-risky:  #dc2626;
}

/* ===== Scroll ===== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 90px;
  width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-mid);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(160deg, var(--secondary) 0%, var(--white) 70%);
    padding: 72px 0 60px;
    text-align: center;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-mid);
    max-width: 500px;
    margin: 0 auto 40px;
    line-height: 1.75;
}

.trust-indicators {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-mid);
}

.trust-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* ===== Shared Card ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ===== Calculator ===== */
.calculator-section {
    padding: 56px 0;
}

.calculator-section .card {
    padding: 40px;
}

.section-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 0.93rem;
    color: var(--text-mid);
    margin-bottom: 32px;
}

.calculator-intro {
    font-size: 0.88rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 16px;
}

/* ===== Form ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 7px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    appearance: none;
    -moz-appearance: textfield;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--white);
}

.form-group input.error {
    border-color: var(--c-very-risky);
}

.field-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 5px;
}

.form-error {
    display: none;
    font-size: 0.85rem;
    color: var(--c-very-risky);
    background: #fff1f1;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.form-error.visible {
    display: block;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

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

.privacy-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 12px;
}

/* ===== Results ===== */
.results-section {
    display: none;
    padding: 0 0 64px;
    scroll-margin-top: 20px;
}

.results-card {
    overflow: hidden;
    animation: fadeUp 0.4s ease;
}

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

/* Result header */
.result-header {
    padding: 32px 40px 28px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.result-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.result-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.result-explanation {
    font-size: 0.97rem;
    color: var(--text-mid);
    line-height: 1.75;
    max-width: 520px;
    margin: 0 auto;
}

/* Metrics grid */
.result-metrics {
    padding: 28px 40px 8px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.metric-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.metric-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.metric-note {
    font-size: 0.75rem;
    color: var(--text-mid);
    margin-top: 3px;
}

.metric-value.alert {
    color: var(--c-very-risky);
}

.metric-value.ok {
    color: var(--c-excellent);
}

.metrics-footnote {
    font-size: 0.73rem;
    color: var(--text-light);
    text-align: center;
    padding-bottom: 20px;
}

/* Score bar */
.result-score-bar {
    padding: 24px 40px 20px;
    border-bottom: 1px solid var(--border);
}

.score-bar-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.score-bar-track {
    position: relative;
    height: 10px;
    border-radius: 10px;
    background: linear-gradient(
        to right,
        #dc2626 0%,
        #ea580c 25%,
        #d97706 50%,
        #65a30d 72%,
        #16a34a 100%
    );
}

.score-bar-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: var(--white);
    border: 3px solid #1e293b;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-bar-zones {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.score-bar-zone {
    font-size: 0.68rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Result message */
.result-message {
    padding: 20px 40px 24px;
    background: var(--secondary);
    border-top: 1px solid var(--border);
}

.recommendation {
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.6;
}

.supportive-text {
    font-size: 0.88rem;
    color: var(--text-mid);
    line-height: 1.6;
}

/* Interpretation block */
.result-interpretation {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px 40px;
    margin-top: 16px;
}

.interp-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.interp-text {
    font-size: 0.88rem;
    color: var(--text-mid);
    line-height: 1.75;
}

/* ===== FAQ Section ===== */
.faq-section {
    padding: 48px 0 72px;
}

.faq-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.faq-item {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-heading {
    margin: 0;
}

.faq-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: none;
    border: none;
    padding: 20px 26px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.faq-toggle:hover {
    background: var(--bg);
}

.faq-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.faq-question {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0;
}

.faq-icon {
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--text-mid);
    border-bottom: 2px solid var(--text-mid);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.faq-item.open .faq-icon {
    transform: rotate(-135deg);
    margin-bottom: -2px;
}

.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease;
}

.faq-body-inner {
    padding: 4px 26px 20px;
}

.faq-answer {
    font-size: 0.88rem;
    color: var(--text-mid);
    line-height: 1.8;
}

/* ===== Page content (sub-pages) ===== */
.page-section {
    padding: 56px 0 72px;
}

.page-section .card {
    padding: 40px;
}

.page-body p {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.75;
    margin-bottom: 14px;
}

.page-body p:last-child {
    margin-bottom: 0;
}

.page-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 24px 0 8px;
}

.page-body h3:first-child {
    margin-top: 0;
}

.page-body ul {
    padding-left: 20px;
    margin-bottom: 14px;
}

.page-body li {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.75;
    margin-bottom: 6px;
}

/* ===== Footer ===== */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
}

.footer-brand {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-bottom: 16px;
}

.footer-nav a {
    font-size: 0.78rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-disclaimer {
    font-size: 0.78rem;
    color: var(--text-light);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .hero-title {
        font-size: 1.7rem;
    }

    .hero {
        padding: 52px 0 44px;
    }

    .trust-indicators {
        gap: 16px;
    }

    .calculator-section .card {
        padding: 28px 24px;
    }

    .result-header {
        padding: 28px 24px 24px;
    }

    .result-score-bar {
        padding: 20px 24px 16px;
    }

    .result-metrics {
        padding: 24px 24px 8px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .result-message {
        padding: 20px 24px;
    }

    .result-interpretation {
        padding: 24px 24px;
    }

    .result-title {
        font-size: 1.35rem;
    }

    .nav {
        gap: 16px;
    }

    .nav-link {
        font-size: 0.78rem;
    }
}
