:root {
    --green-950: #063326;
    --green-900: #0a4331;
    --green-800: #0b513a;
    --green-700: #0e6748;
    --green-100: #dcefe7;
    --green-50: #f0f8f4;
    --cream: #f8f7f1;
    --white: #ffffff;
    --ink: #173229;
    --muted: #60726c;
    --line: #d9e3de;
    --warning: #a34032;
    --shadow: 0 18px 55px rgba(7, 55, 39, .12);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--white); font: 16px/1.65 Inter, "Segoe UI", Arial, sans-serif; }
body, button, input { font-family: Inter, "Segoe UI", Arial, sans-serif; }
h1, h2, h3 { margin: 0 0 .65rem; font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.16; letter-spacing: -.035em; }
h1 { font-size: clamp(2.35rem, 6vw, 4.9rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.65rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
button, input { font-size: 1rem; }
button, a { -webkit-tap-highlight-color: transparent; }
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.section { padding: 86px 0; }
.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; }
.skip-link { position: fixed; z-index: 999; top: 8px; left: 8px; padding: 10px 14px; color: #fff; background: var(--green-950); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.eyebrow { display: block; margin-bottom: 12px; color: var(--green-700); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #a9dcc8; }

.site-header { position: relative; z-index: 20; color: #fff; background: var(--green-950); }
.header-inner { display: flex; align-items: center; justify-content: space-between; width: min(1180px, calc(100% - 40px)); min-height: 82px; margin: auto; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 41px; height: 41px; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; color: var(--green-950); background: #fff; font: 800 .78rem Inter, "Segoe UI", Arial, sans-serif; }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font-family: Inter, "Segoe UI", Arial, sans-serif; }
.brand small { color: #acd2c3; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.main-nav { display: flex; gap: 26px; align-items: center; font-size: .93rem; font-weight: 600; }
.main-nav > a:not(.button) { color: #d7ebe3; }
.main-nav > a.active, .main-nav > a:hover { color: #fff; }
.nav-toggle { display: none; width: 42px; padding: 8px; border: 0; background: transparent; }
.nav-toggle > span:not(.sr-only) { display: block; height: 2px; margin: 5px 0; background: #fff; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-weight: 700; line-height: 1.2; transition: transform .2s, background .2s, border-color .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff; background: var(--green-700); box-shadow: 0 8px 25px rgba(8, 92, 62, .2); }
.button-primary:hover { background: var(--green-800); }
.button-light { color: var(--green-950); background: #fff; }
.button-outline { color: #fff; border-color: rgba(255,255,255,.45); }
.button-ghost { color: var(--green-800); border-color: var(--line); background: #fff; }
.button-danger-outline { color: var(--warning); border-color: #e4b6af; background: #fff; }
.button-small { min-height: 38px; padding: 8px 16px; font-size: .88rem; }
.button-large { min-height: 56px; padding-inline: 30px; }
.button-full { width: 100%; }
.text-link { color: var(--green-800); font-weight: 700; }
.back-link { display: inline-block; margin-bottom: 30px; color: var(--green-700); font-weight: 700; }
.light-link { color: #d4eee4; }

.hero { position: relative; overflow: hidden; color: #fff; background: var(--green-950); }
.hero::before { position: absolute; inset: 0; content: ""; opacity: .28; background: radial-gradient(circle at 80% 25%, #318264 0, transparent 35%), linear-gradient(125deg, transparent 55%, rgba(255,255,255,.05) 55%); }
.hero-content { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 80px; align-items: center; min-height: 690px; padding-block: 82px 105px; }
.hero h1 span { color: #9dddc3; }
.hero .lead { max-width: 650px; color: #d0e5dc; font-size: 1.2rem; }
.hero-actions { display: flex; gap: 24px; align-items: center; margin: 32px 0; }
.hero .text-link { color: #fff; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0; color: #bad8cc; font-size: .9rem; list-style: none; }
.check-list li::before { content: "✓"; margin-right: 7px; color: #8be0bd; font-weight: 800; }
.hero-card { padding: 30px; border: 1px solid rgba(255,255,255,.2); border-radius: 26px; color: var(--ink); background: rgba(255,255,255,.97); box-shadow: 0 28px 80px rgba(0,0,0,.22); transform: rotate(1.5deg); }
.hero-card-top { display: flex; justify-content: space-between; font-size: .9rem; }
.mini-progress, .large-progress { height: 8px; overflow: hidden; margin: 15px 0 26px; border-radius: 99px; background: var(--green-100); }
.mini-progress span, .large-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green-700); }
.dialog-preview { display: flex; gap: 12px; margin: 14px 0; padding: 15px; border-radius: 14px; background: var(--green-50); }
.dialog-preview.reply { margin-left: 32px; background: #f5efe5; }
.dialog-preview p { margin: 2px 0 0; font-size: .94rem; }
.dialog-preview small, .dialog-line small { color: var(--muted); font-weight: 700; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: var(--green-700); font-weight: 800; }
.avatar-patient { background: #b47b4e; }
.speak-button { width: 100%; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--green-800); background: #fff; cursor: pointer; font-weight: 700; }
.speak-button.is-speaking, [data-speak].is-speaking { color: #fff; background: var(--green-700); }

.trust-strip { padding: 28px 0; background: var(--cream); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats-grid div { display: grid; place-items: center; padding: 10px; border-right: 1px solid #d7dbd2; }
.stats-grid div:last-child { border: 0; }
.stats-grid strong { font: 800 1.3rem Inter, "Segoe UI", Arial, sans-serif; }
.stats-grid span { color: var(--muted); font-size: .82rem; }
.section-heading { max-width: 670px; margin-bottom: 42px; }
.section-heading p { color: var(--muted); }
.lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lesson-card { min-height: 240px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform .2s, box-shadow .2s; }
.lesson-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.lesson-card:nth-child(4), .lesson-card:nth-child(5) { grid-column: span 1; }
.lesson-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 28px; border-radius: 14px; background: var(--green-50); font-size: 1.6rem; }
.lesson-meta { display: block; margin-bottom: 5px; color: var(--green-700); font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.lesson-card p, .course-info p { color: var(--muted); }
.cta-section { background: var(--cream); }
.cta-card { display: flex; justify-content: space-between; align-items: center; padding: 54px; border-radius: 25px; color: #fff; background: var(--green-900); }
.cta-card p { max-width: 680px; margin-bottom: 0; color: #c8e0d6; }

.flash { width: min(800px, calc(100% - 32px)); margin: 18px auto -5px; padding: 13px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.flash-success { color: var(--green-800); background: var(--green-50); }
.auth-section { display: grid; min-height: calc(100vh - 320px); padding: 70px 20px; place-items: center; background: var(--cream); }
.auth-card { width: min(500px, 100%); padding: 44px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.auth-card-wide { width: min(560px, 100%); }
.auth-card h1 { font-size: 2.2rem; }
.auth-card > p { color: var(--muted); }
.success-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; border-radius: 50%; color: #fff; background: var(--green-700); font-size: 1.5rem; font-weight: 800; }
.form-stack { display: grid; gap: 9px; margin-top: 24px; }
.form-stack label { margin-top: 7px; font-size: .9rem; font-weight: 700; }
.form-stack input { width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid #bdcac4; border-radius: 10px; outline: none; background: #fff; }
.form-stack input:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(14,103,72,.12); }
.password-field { position: relative; }
.password-field input { padding-right: 85px; }
.password-field button { position: absolute; top: 50%; right: 10px; border: 0; color: var(--green-700); background: none; transform: translateY(-50%); cursor: pointer; font-size: .8rem; font-weight: 700; }
.password-rules { display: flex; gap: 7px; flex-wrap: wrap; margin: 4px 0; }
.password-rules span { padding: 4px 8px; border-radius: 99px; color: var(--muted); background: #eef2f0; font-size: .72rem; }
.password-rules span.valid { color: var(--green-800); background: var(--green-100); }
.form-alert { margin: 18px 0; padding: 12px 14px; border-left: 4px solid var(--warning); color: #743126; background: #fff2f0; }
.form-help { margin: 22px 0 0 !important; font-size: .86rem; text-align: center; }

.dashboard-hero, .page-hero, .lesson-hero { color: #fff; background: var(--green-950); }
.dashboard-welcome { display: flex; justify-content: space-between; align-items: center; padding-block: 58px; }
.dashboard-welcome h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); }
.dashboard-welcome p { color: #cbe1d8; }
.progress-ring { display: grid; width: 128px; height: 128px; border-radius: 50%; background: conic-gradient(#8fdbbd calc(var(--progress) * 1%), rgba(255,255,255,.14) 0); place-items: center; }
.progress-ring::before { grid-area: 1/1; width: 104px; height: 104px; border-radius: 50%; content: ""; background: var(--green-950); }
.progress-ring span { z-index: 1; display: grid; grid-area: 1/1; text-align: center; }
.progress-ring strong { font-size: 1.4rem; }
.progress-ring small { color: #b8d6ca; }
.dashboard-content { padding-top: 55px; }
.continue-card { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; margin-bottom: 70px; padding: 30px; border: 1px solid #b9dbce; border-radius: var(--radius); background: var(--green-50); }
.continue-card h2 { font-size: 1.45rem; }
.continue-card p { margin: 0; color: var(--muted); }
.continue-number, .course-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 15px; background: #fff; font-size: 1.75rem; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.completion-label { padding: 7px 12px; border-radius: 99px; color: var(--green-800); background: var(--green-100); font-size: .82rem; font-weight: 700; }
.lesson-list { display: grid; gap: 14px; }
.course-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 20px; align-items: center; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.course-state { display: grid; width: 31px; height: 31px; border: 2px solid #b9c9c2; border-radius: 50%; color: var(--muted); place-items: center; font-weight: 800; }
.course-row.is-complete .course-state { color: #fff; border-color: var(--green-700); background: var(--green-700); }
.course-row.is-locked { opacity: .62; background: #f7f8f7; }
.course-info h3, .course-info p { margin: 0; }
.course-info p { font-size: .9rem; }
.locked-label { max-width: 120px; color: var(--muted); font-size: .75rem; text-align: right; }
.page-hero.compact .container { padding-block: 55px; }
.page-hero.compact h1 { font-size: 3rem; }
.page-hero.compact p { margin: 0; color: #cbe1d8; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(7,55,39,.05); }
.account-data { margin: 15px 0 0; }
.account-data div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.account-data dt { color: var(--muted); }
.account-data dd { margin: 0; font-weight: 700; text-align: right; }
.account-help { grid-column: 1 / -1; color: #fff; background: var(--green-900); }
.account-help p { margin: 0; color: #cbe1d8; }

.lesson-hero .container { padding-block: 42px 30px; }
.lesson-hero-row { display: flex; justify-content: space-between; gap: 30px; align-items: center; }
.lesson-hero h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); }
.lesson-hero p { max-width: 760px; color: #cbe1d8; }
.lesson-status { padding: 8px 13px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; white-space: nowrap; font-size: .8rem; font-weight: 700; }
.lesson-status.done { color: var(--green-950); background: #a8e1c9; }
.step-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 25px; }
.step-progress span { height: 4px; border-radius: 9px; background: rgba(255,255,255,.15); }
.step-progress span.active { background: #8fdbbd; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 55px; align-items: start; }
.lesson-main { min-width: 0; }
.content-block { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 20px; padding: 0 0 55px; }
.block-number { display: grid; width: 42px; height: 42px; border-radius: 50%; color: var(--green-800); background: var(--green-100); place-items: center; font-size: .78rem; font-weight: 800; }
.lead-small { color: var(--muted); font-size: 1.1rem; }
.block-wide { min-width: 0; }
.phrase-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.phrase-row { display: flex; gap: 15px; align-items: center; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.phrase-row:last-child { border: 0; }
.phrase-row strong, .phrase-row small { display: block; }
.phrase-row small { color: var(--muted); }
.round-speak { display: grid; flex: 0 0 auto; width: 37px; height: 37px; border: 0; border-radius: 50%; color: var(--green-800); background: var(--green-100); cursor: pointer; place-items: center; }
.dialog-card { padding: 24px; border-radius: 17px; background: var(--green-50); }
.dialog-line { display: flex; gap: 13px; width: 86%; margin-bottom: 18px; }
.dialog-line.patient-line { margin-left: auto; }
.dialog-line.patient-line .avatar { background: #b47b4e; }
.dialog-line > div { flex: 1; padding: 13px 15px; border-radius: 0 12px 12px; background: #fff; box-shadow: 0 5px 18px rgba(7,55,39,.06); }
.dialog-line p { margin: 2px 0 7px; }
.dialog-line button { padding: 0; border: 0; color: var(--green-700); background: none; cursor: pointer; font-size: .74rem; font-weight: 700; }
.dialog-play { margin-top: 12px; }
.tip-card { display: flex; gap: 15px; margin: 0 0 55px 68px; padding: 22px; border-left: 4px solid #c29749; border-radius: 0 12px 12px 0; background: #fcf7e9; }
.tip-card > span { font-size: 1.5rem; }
.tip-card p { margin: 4px 0 0; }
.quiz-card { margin: 0 0 35px 68px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); }
.quiz-card h2 { font-size: 1.45rem; }
.quiz-form { display: grid; gap: 10px; }
.quiz-form label { cursor: pointer; }
.quiz-form input { position: absolute; opacity: 0; }
.quiz-form label span { display: block; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; }
.quiz-form input:checked + span { border-color: var(--green-700); background: var(--green-50); box-shadow: 0 0 0 2px rgba(14,103,72,.12); }
.quiz-form .button { justify-self: start; margin-top: 8px; }
.quiz-feedback { margin: 14px 0; padding: 11px 14px; border-radius: 8px; }
.quiz-feedback.correct { color: var(--green-800); background: var(--green-100); }
.quiz-feedback.incorrect { color: #7d382f; background: #fff0ed; }
.lesson-complete-form { margin-left: 68px; text-align: right; }
.lesson-sidebar { position: sticky; top: 20px; display: grid; gap: 16px; }
.sidebar-card { padding: 22px; border: 1px solid var(--line); border-radius: 14px; }
.sidebar-card ol { padding-left: 20px; color: var(--muted); }
.sidebar-card p { color: var(--muted); font-size: .9rem; }
.sidebar-card a { color: var(--green-700); font-weight: 700; }

.legal-page { width: min(820px, calc(100% - 40px)); margin: auto; padding: 70px 0; }
.legal-page h1 { font-size: 3rem; }
.legal-page h2 { margin-top: 38px; font-size: 1.5rem; }
.legal-page p, .legal-page li { color: #455d54; }
.placeholder-note { padding: 15px; border-left: 4px solid #c29749; background: #fcf7e9; }
.site-footer { padding: 45px 0; color: #c8ddd5; background: #052d22; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px; width: min(1120px, calc(100% - 40px)); margin: auto; }
.footer-inner p { margin: 5px 0 0; color: #93b5a8; font-size: .88rem; }
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner small { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); color: #7ba091; }

@media (max-width: 850px) {
    .hero-content { grid-template-columns: 1fr; gap: 40px; }
    .hero-card { max-width: 590px; transform: none; }
    .lesson-grid { grid-template-columns: 1fr 1fr; }
    .lesson-layout { grid-template-columns: 1fr; }
    .lesson-sidebar { position: static; grid-template-columns: 1fr 1fr; }
    .course-row { grid-template-columns: auto auto 1fr; }
    .course-row .button, .locked-label { grid-column: 3; justify-self: start; }
}

@media (max-width: 650px) {
    .container, .header-inner, .footer-inner { width: min(100% - 28px, 1120px); }
    .section { padding: 58px 0; }
    .header-inner { min-height: 68px; }
    .nav-toggle { display: block; }
    .main-nav { position: absolute; top: 68px; right: 0; left: 0; display: none; padding: 18px 20px 24px; background: var(--green-950); box-shadow: 0 12px 20px rgba(0,0,0,.18); }
    .main-nav.open { display: grid; }
    .main-nav .button { justify-self: stretch; }
    .hero-content { min-height: auto; padding-block: 58px 75px; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-actions .text-link { text-align: center; }
    .check-list { display: grid; }
    .hero-card { padding: 21px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0; }
    .stats-grid div:nth-child(2) { border-right: 0; }
    .stats-grid div { border-bottom: 1px solid #d7dbd2; }
    .stats-grid div:nth-child(n+3) { border-bottom: 0; }
    .lesson-grid { grid-template-columns: 1fr; }
    .cta-card { align-items: stretch; flex-direction: column; gap: 25px; padding: 32px 25px; }
    .auth-card { padding: 29px 22px; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column; gap: 25px; }
    .progress-ring { width: 100px; height: 100px; }
    .progress-ring::before { width: 80px; height: 80px; }
    .continue-card { grid-template-columns: auto 1fr; padding: 21px; }
    .continue-card .button { grid-column: 1 / -1; }
    .dashboard-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .course-row { grid-template-columns: auto 1fr; gap: 13px; }
    .course-icon { width: 48px; height: 48px; }
    .course-info, .course-row .button, .locked-label { grid-column: 2; }
    .course-state { grid-row: 1 / span 2; }
    .account-grid { grid-template-columns: 1fr; }
    .account-help { grid-column: auto; }
    .account-data div { align-items: flex-start; flex-direction: column; gap: 2px; }
    .account-data dd { text-align: left; word-break: break-word; }
    .lesson-hero-row { align-items: flex-start; flex-direction: column; }
    .content-block { grid-template-columns: 1fr; gap: 12px; }
    .block-number { width: 36px; height: 36px; }
    .dialog-card { padding: 15px; }
    .dialog-line { width: 96%; }
    .tip-card, .quiz-card, .lesson-complete-form { margin-left: 0; }
    .lesson-sidebar { grid-template-columns: 1fr; }
    .lesson-complete-form .button { width: 100%; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-inner nav { flex-wrap: wrap; }
    .footer-inner small { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
