/* «Друге життя» — стилі сайту */
:root {
  --green: #1E3A2B;
  --green-2: #26402F;
  --ink: #142019;
  --muted: #45554A;
  --ground: #F3F4EE;
  --card: #FFFFFF;
  --line: #D5DBD3;
  --line-soft: #E8EBE6;
  --input: #C5CFC7;
  --cream: #F5F2E9;
  --on-dark: #DCE4DD;
  --gold: #E2B266;
  --lime: #B8E07A;
  --lime-ink: #13261A;
  --lime-soft: #EEF5E3;
  --sage: #DDE8D9;
  --soil-bg: #F2ECE5;
  --soil: #6B4A2E;
  --soil-ink: #4A3221;
  --warn-bg: #F7E6E0;
  --warn: #8E3522;
  --warn-on-dark: #F2A58E;
  --amber-bg: #FBF1DE;
  --amber: #7A5310;
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --body: 'Onest', system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --r-lg: 36px;
  --r-md: 28px;
  --r-sm: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #3E8A2A; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; flex-wrap: wrap; gap: var(--gap, 16px); align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: var(--gap, 16px); align-items: flex-end; justify-content: space-between; }
.grow { flex: 1 1 var(--basis, 320px); min-width: 0; }
.grow-2 { flex: 2 1 var(--basis, 560px); min-width: 0; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 300px)), 1fr)); gap: var(--gap, 20px); }
.section { padding-top: clamp(72px, 9vw, 140px); }
.page { padding-top: clamp(32px, 4vw, 56px); padding-bottom: clamp(56px, 6vw, 96px); }

/* Типографіка */
.display { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(42px, 6vw, 88px); line-height: 1.02; letter-spacing: -0.03em; }
.h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
.h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
.h3 { margin: 0; font-size: clamp(22px, 2vw, 26px); font-weight: 700; line-height: 1.2; }
.h4 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; }
.lead { margin: 0; font-size: clamp(19px, 1.5vw, 23px); line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.tiny { font-size: 15px; }
.num { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.02; }
.num-xl { font-size: clamp(48px, 6vw, 92px); letter-spacing: -0.03em; }
.num-lg { font-size: clamp(40px, 4vw, 60px); }
.num-md { font-size: clamp(32px, 3.2vw, 46px); }
.num .unit { font-size: 0.4em; letter-spacing: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }
.warn-text { color: var(--warn); }
.eyebrow { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Шапка */
.topbar { background: var(--green); color: var(--cream); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0; }
.logo img { height: 48px; width: auto; }
.nav-links { order: 3; flex: 1 1 420px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.nav-links a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 999px; color: var(--on-dark); font-size: 17px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--cream); background: rgba(245, 242, 233, 0.08); }
.nav-links a[aria-current="page"] { background: var(--cream); color: var(--green); font-weight: 700; }
.nav-actions { order: 2; display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; align-items: center; }
.tabs-scroll { order: 3; flex: 1 1 100%; display: flex; gap: 6px; overflow-x: auto; }
.tabs-scroll a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 999px; color: var(--on-dark); font-size: 17px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs-scroll a[aria-current="page"] { background: var(--cream); color: var(--green); font-weight: 700; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px; border-radius: 999px; border: 2px solid transparent; font-size: 18px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform 0.15s ease-out, background-color 0.15s ease-out; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-lg { min-height: 64px; padding: 0 32px; font-size: 19px; }
.btn-sm { min-height: 48px; padding: 0 20px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); color: var(--lime-ink); }
.btn-gold:hover { background: #E8BF7A; }
.btn-lime { background: var(--lime); color: var(--lime-ink); }
.btn-dark { background: var(--green); color: #FFFFFF; }
.btn-dark:hover { background: #24452F; }
.btn-outline { background: #FFFFFF; border-color: var(--green); color: var(--green); }
.btn-outline-light { background: transparent; border-color: rgba(245, 242, 233, 0.45); color: var(--cream); }
.btn-outline-light:hover { border-color: var(--cream); }
.btn-text { background: transparent; color: var(--green); padding: 0 8px; min-height: 48px; }
.btn-danger { background: var(--warn); color: #FFFFFF; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font-size: 17px; font-weight: 700; color: var(--green); }

/* Картки */
.card { background: var(--card); border-radius: var(--r-md); padding: clamp(24px, 3vw, 36px); }
.card-lg { border-radius: var(--r-lg); padding: clamp(28px, 3.4vw, 48px); }
.card-dark { background: var(--green); color: var(--cream); }
.card-sage { background: var(--sage); }
.card-soil { background: var(--soil-bg); color: var(--soil-ink); }
.card-warn { background: var(--warn-bg); color: #4A1C12; }
.card-lime { background: var(--lime); color: var(--lime-ink); }
.card-dark .muted { color: var(--on-dark); }
.card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; transition: transform 0.15s ease-out; }
.card-link:hover { transform: translateY(-2px); }
.motif { position: absolute; pointer-events: none; opacity: 0.07; }
.relative { position: relative; overflow: hidden; }

/* Поля форм */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span, .label { font-size: 16px; font-weight: 600; }
.input, .select, .textarea { width: 100%; min-height: 60px; padding: 0 16px; border-radius: 16px; border: 2px solid var(--input); background: #FFFFFF; font-size: 20px; font-variant-numeric: tabular-nums; }
.textarea { min-height: 120px; padding: 14px 16px; font-size: 18px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px #E3F1D2; }
.input-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--line-soft); font-size: 18px; }
.input-row .input { width: 120px; min-height: 48px; text-align: right; font-size: 18px; }
.hint { margin: 0; padding: 14px 18px; border-radius: 16px; background: #EEF1EC; font-size: 17px; line-height: 1.5; }
.error-text { margin: 0; color: var(--warn); font-size: 16px; font-weight: 600; }
.check { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; line-height: 1.5; }
.check input { margin: 2px 0 0; width: 24px; height: 24px; accent-color: var(--green); flex-shrink: 0; }

/* Чіпи і сегменти */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-height: 52px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--input); background: #FFFFFF; font-size: 17px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #FFFFFF; font-weight: 700; }
.chip-dashed { border-style: dashed; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 4px; padding: 5px; border-radius: 18px; background: #EEF1EC; }
.seg button { min-height: 52px; border: 0; border-radius: 14px; background: transparent; font-size: 17px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--green); color: #FFFFFF; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 700; }
.pill-lime { background: var(--lime); color: var(--lime-ink); }
.pill-soft { background: var(--lime-soft); color: #2E5A1C; }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-gold { background: var(--gold); color: var(--lime-ink); }
.step-num { width: 36px; height: 36px; border-radius: 999px; background: var(--green); color: var(--cream); font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Графіки */
.bars { display: flex; align-items: flex-end; gap: 12px; height: var(--h, 180px); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; min-width: 0; }
.bar { width: 100%; border-radius: 14px 14px 6px 6px; background: var(--green); min-height: 4px; }
.bar-label { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar { height: 14px; border-radius: 7px; background: #EEF1EC; display: flex; overflow: hidden; }
.hbar > span { display: block; height: 100%; border-radius: 7px; background: var(--green); }

/* Таблиці */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 17px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 15px; font-weight: 500; color: var(--muted); padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td, .table tbody th { padding: 14px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.table tbody th { font-weight: 600; color: var(--ink); font-size: 17px; }
.table .r { text-align: right; }

/* Повідомлення */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 16px 22px; border-radius: 18px; background: var(--ink); color: #FFFFFF; font-size: 17px; font-weight: 600; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6); }
.banner { padding: 16px 20px; border-radius: 18px; background: var(--amber-bg); color: #4A3A1C; font-size: 17px; }
.empty { text-align: center; padding: clamp(32px, 5vw, 64px) 20px; }

/* Діалог */
dialog { border: 0; border-radius: var(--r-md); padding: clamp(24px, 3vw, 36px); max-width: min(560px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(14, 29, 20, 0.6); }

/* Кроки імпорту */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.steps li { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 8px; border-radius: 999px; background: #FFFFFF; font-size: 17px; }
.steps li .dot { width: 36px; height: 36px; border-radius: 999px; background: #EEF1EC; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.steps li[aria-current="step"] { background: var(--green); color: #FFFFFF; font-weight: 700; }
.steps li[aria-current="step"] .dot { background: var(--lime); color: var(--lime-ink); }
.steps li.done .dot { background: #E6F2E2; color: #1D5B34; }
.dropzone { border: 2.5px dashed #9FB0A3; border-radius: var(--r-md); background: #F7F9F4; padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.dropzone.over { border-color: var(--green); background: var(--lime-soft); }
.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.source { min-height: 96px; padding: 16px 18px; border-radius: 22px; border: 2px solid var(--line); background: #FFFFFF; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; text-align: left; cursor: pointer; }
.source strong { font-size: 19px; }
.source span { font-size: 15px; opacity: 0.8; }
.source[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #FFFFFF; }

/* Сторінка входу */
.auth-bg { min-height: 100vh; background: #2A3B30; padding: clamp(12px, 4vw, 64px) clamp(12px, 4vw, 40px); display: flex; align-items: center; justify-content: center; }
.auth-box { width: 100%; max-width: 1040px; background: #FFFFFF; border-radius: clamp(28px, 3vw, 40px); overflow: hidden; display: flex; flex-wrap: wrap; box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.6); }
.auth-side { flex: 1 1 380px; padding: clamp(28px, 3.6vw, 52px); display: flex; flex-direction: column; gap: 28px; }
.auth-main { flex: 1.2 1 420px; padding: clamp(28px, 3.6vw, 52px); display: flex; flex-direction: column; gap: 24px; position: relative; min-width: 0; }
.code-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-width: 440px; }
.code-grid input { min-height: 68px; border-radius: 16px; border: 2px solid var(--input); text-align: center; font-family: var(--display); font-size: 26px; font-weight: 600; width: 100%; }
.code-grid input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px #E3F1D2; }
.icon-btn { width: 48px; height: 48px; border-radius: 999px; border: 0; background: #F3F4EE; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; color: var(--ink); }
.close-btn { position: absolute; top: 18px; right: 18px; }
.tabs-pill { align-self: flex-start; display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: #F3F4EE; }
.tabs-pill button { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; background: transparent; font-size: 17px; font-weight: 500; cursor: pointer; }
.tabs-pill button[aria-selected="true"] { background: var(--green); color: #FFFFFF; font-weight: 700; }

/* Футер */
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 32px 0; font-size: 16px; color: var(--muted); }
.footer a { color: #2E3D33; min-height: 48px; display: inline-flex; align-items: center; }

/* Головна */
.hero { background: var(--green); color: var(--cream); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: clamp(40px, 5vw, 80px); align-items: center; padding: clamp(36px, 6vw, 96px) 0 clamp(64px, 8vw, 128px); }
.float-chip { position: absolute; right: -8px; top: 0; padding: 12px 18px; border-radius: 18px; background: var(--lime); color: var(--lime-ink); font-size: 16px; font-weight: 700; box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.5); display: flex; align-items: center; gap: 8px; }
.crop-band { background: var(--gold); padding: 22px var(--gutter); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 28px; font-family: var(--display); font-size: clamp(20px, 2.2vw, 30px); font-weight: 600; color: var(--lime-ink); }
.crop-band i { width: 10px; height: 10px; border-radius: 999px; background: var(--green); }
.big-step { font-family: var(--display); font-size: 72px; font-weight: 600; line-height: 0.9; color: var(--lime); -webkit-text-stroke: 2px var(--green); }
details.faq { background: #FFFFFF; border-radius: 24px; padding: 6px 28px; }
details.faq summary { min-height: 72px; display: flex; align-items: center; font-size: 21px; font-weight: 600; cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq p { margin: 0 0 24px; font-size: 18px; line-height: 1.6; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .btn, .card-link { transition: none; }
  .btn:hover, .card-link:hover { transform: none; }
}

@media print {
  body { background: #FFFFFF; font-size: 12pt; }
  .topbar, .no-print, .footer, .toast { display: none !important; }
  .card, .card-lg { break-inside: avoid; }
  .card-dark { background: var(--green) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
