:root {
    --ink: #17211b;
    --muted: #66736b;
    --paper: #f5f7f3;
    --surface: #ffffff;
    --line: #dce4dd;
    --green: #176b45;
    --green-dark: #0f4f34;
    --green-soft: #e5f3eb;
    --amber: #a15c00;
    --amber-soft: #fff2d8;
    --red: #a63131;
    --red-soft: #fbeaea;
    --shadow: 0 18px 50px rgba(23, 33, 27, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 85% 5%, #dcefe4 0, transparent 26rem), var(--paper); }
a { color: var(--green-dark); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, .button { min-height: 44px; }
.container { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 10; padding: .75rem 1rem; background: var(--ink); color: #fff; }
.skip-link:focus { top: 1rem; }
.site-header { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border-radius: 12px; color: #fff; background: var(--green); font-weight: 800; }
nav { display: flex; gap: 1rem; flex: 1; }
nav a { color: var(--ink); text-decoration: none; font-size: .94rem; }
nav a:hover { color: var(--green); }
.account-menu { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .9rem; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--green-dark); text-decoration: underline; cursor: pointer; min-height: auto; }
.main-content { flex: 1; padding-block: clamp(2rem, 5vw, 4.5rem); }
.site-footer { padding: 2rem 0; color: var(--muted); border-top: 1px solid var(--line); font-size: .9rem; }
h1, h2 { letter-spacing: -.035em; line-height: 1.1; }
h1 { font-size: clamp(2rem, 5vw, 4.2rem); margin: .25rem 0 1rem; max-width: 17ch; }
h2 { font-size: clamp(1.25rem, 2.3vw, 1.65rem); margin: 0 0 .8rem; }
p { line-height: 1.65; }
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 58ch; color: var(--muted); }
.eyebrow { color: var(--green); font-size: .77rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; padding: 2rem 0 5rem; }
.hero-card, .panel, .card { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.hero-card { padding: clamp(1.5rem, 4vw, 2.5rem); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.5rem; }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid transparent; padding: .7rem 1rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { background: #fff; color: var(--green-dark); border-color: #9db9a8; }
.button.danger { background: var(--red-soft); color: var(--red); border-color: #e7b4b4; }
.button.small { min-height: 36px; padding: .42rem .65rem; font-size: .86rem; }
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.align-start { align-items: start; }
.card, .panel { padding: clamp(1.25rem, 3vw, 2rem); }
.step { display: inline-grid; place-items: center; width: 2.4rem; aspect-ratio: 1; margin-bottom: 1rem; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-weight: 800; }
.feature-list { list-style: none; padding: 0; margin: 1rem 0; }
.feature-list li { position: relative; padding: .55rem 0 .55rem 1.7rem; border-bottom: 1px solid var(--line); }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.auth-shell { display: grid; place-items: center; }
.narrow { width: min(100%, 520px); }
.narrow-left { width: min(100%, 680px); }
.form-panel { width: min(100%, 720px); }
.form-stack { display: grid; gap: 1rem; margin-top: 1.4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: grid; gap: .42rem; font-weight: 700; font-size: .92rem; }
label small { color: var(--muted); font-weight: 400; }
input, select { width: 100%; min-height: 46px; border: 1px solid #b9c6bc; border-radius: 10px; padding: .7rem .8rem; background: #fff; color: var(--ink); }
input[readonly] { background: #eef1ed; color: var(--muted); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(23,107,69,.25); outline-offset: 2px; }
.password-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: stretch; }
.password-toggle { min-width: 88px; border: 1px solid #9db9a8; border-radius: 10px; padding: .55rem .75rem; background: #fff; color: var(--green-dark); font-weight: 700; cursor: pointer; }
.password-toggle:hover { background: var(--green-soft); }
.check { display: flex; align-items: flex-start; gap: .65rem; font-weight: 500; }
.check input { width: 1.15rem; min-height: 1.15rem; margin-top: .15rem; accent-color: var(--green); }
.sub-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; font-size: .92rem; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alert { border-radius: 12px; padding: 1rem 1.15rem; margin-bottom: 1.25rem; border: 1px solid; }
.alert ul { margin-bottom: 0; }
.alert.success { background: var(--green-soft); color: var(--green-dark); border-color: #a7d4b9; }
.alert.warning { background: var(--amber-soft); color: #724000; border-color: #e7c584; }
.alert.error { background: var(--red-soft); color: #782020; border-color: #e4aaaa; }
.field-error { color: var(--red); margin: 0; font-size: .9rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.page-heading h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.page-heading p { max-width: 65ch; }
.status-pill { display: inline-flex; align-items: center; padding: .34rem .65rem; border-radius: 999px; background: #edf0ed; color: var(--ink); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.status-pill.ok { background: var(--green-soft); color: var(--green-dark); }
.status-pill.pending { background: var(--amber-soft); color: var(--amber); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1.3rem; border-radius: 18px; background: var(--ink); color: #fff; }
.stat span { display: block; color: #bed0c4; font-size: .85rem; }
.stat strong { display: block; margin-top: .45rem; font-size: clamp(1.4rem, 3vw, 2rem); }
.panel + .panel, .grid + .panel, .panel + .grid { margin-top: 1.25rem; }
.disabled-module { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.disabled-module span { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: .85rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .77rem; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: .92rem; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.inline-form label { min-width: 120px; }
.inline-form .check { min-width: auto; align-self: center; }
.muted-panel { background: #eef1ed; box-shadow: none; }
.qr-code { display: grid; place-items: center; width: fit-content; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qr-code svg { width: min(240px, 70vw); height: auto; }
.recovery-sheet { border: 2px solid var(--green); margin-bottom: 1.25rem; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 2rem; padding-left: 1.6rem; }
.recovery-codes code { font-size: 1rem; letter-spacing: .04em; }
.facts { margin: 1rem 0; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.session-list { display: grid; gap: .8rem; }
.session-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; }
.session-item p { margin: .3rem 0; word-break: break-word; }
.session-item small { color: var(--muted); }

@media (max-width: 820px) {
    .header-inner { flex-wrap: wrap; padding-block: .8rem; gap: .8rem 1.2rem; }
    nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: .25rem; }
    .account-menu { margin-left: auto; }
    .hero, .grid.two, .grid.three { grid-template-columns: 1fr; }
    .hero { padding-top: 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-heading { flex-direction: column; gap: .5rem; }
}

@media (max-width: 540px) {
    .container { width: min(100% - 1.1rem, 1180px); }
    .account-menu > span { display: none; }
    .form-grid, .recovery-codes { grid-template-columns: 1fr; }
    .sub-actions, .session-item { align-items: flex-start; flex-direction: column; }
    .button { width: 100%; }
    .inline-form .button, .page-heading .button, .session-item .button { width: auto; }
    .panel, .card, .hero-card { border-radius: 16px; }
}

@media print {
    body { background: #fff; }
    .site-header, .site-footer, .no-print, .alert, .page-heading, .panel:not(.recovery-sheet) { display: none !important; }
    .main-content { padding: 0; }
    .recovery-sheet { border: 1px solid #000; box-shadow: none; }
}
