/* NatanielTheme — токены дизайн-системы «Натаниэль» (единственная светлая тема) */
:root {
  --surface: #FFFFFF;
  --surface-soft: #F1F5F6;
  --surface-input: #F5F7FA;
  --surface-neutral: #E5E5E5;
  --line-hairline: #F2F2F2;
  --line-soft: #BDBDBD;
  --ink: #4F4F4F;
  --ink-muted: #828282;
  --ink-deep: #102736;
  --gold: #CEB286;
  --gold-deep: #6A5D49;
  --gold-80: rgba(206,178,134,0.80);
  --sky: #AAC9DE;
  --sky-line: #B1CBF1;
  --danger: #A33A2B;      /* текст ошибок: 6.4:1 на белом */
  --success: #2F6B4A;     /* текст «+48»: 6.3:1 на белом */

  --font-display: "Tenor Sans", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;

  --space-1: 10px; --space-2: 14px; --space-3: 20px; --space-4: 30px; --space-5: 60px; --space-6: 90px;
  --radius-sm: 20px; --radius-md: 30px; --radius-lg: 50px; --radius-pill: 500px;
  --shadow-button: inset 0 -1px 1px 0 rgba(0,0,0,0.10);
  --shadow-header: 0 10px 10px 0 rgba(0,0,0,0.03);
  --shadow-pop: 0 5px 15px 0 rgba(0,0,0,0.2);
  --gloss: radial-gradient(100% 100% at 50% 100%, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 400 16px/1.45 var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.2; color: var(--ink); }
h1 { font-size: 30px; } h2 { font-size: 26px; } h3 { font-size: 22px; } h4 { font-size: 18px; }
p { margin: 0; }
a { color: var(--ink-deep); }
small, .caption { font-size: 12px; }
.muted { color: var(--ink-muted); }
.body-sm { font-size: 14px; }
.bold { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.plus { color: var(--success); }
.minus { color: var(--ink); }
.error-text { color: var(--danger); font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Кнопки: таблетка, внутренняя тень, белый блик ---------- */
.btn {
  font-family: var(--font-sans); font-weight: 500; font-size: 16px; line-height: 1.2;
  color: var(--ink-deep); border: 0; border-radius: var(--radius-pill); box-shadow: var(--shadow-button);
  min-height: 48px; padding: 12px 28px; cursor: pointer; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 300ms ease; background: var(--gloss), var(--sky);
  user-select: none;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) { .btn:hover { transform: scale(1.03); } .btn:active { transform: scale(0.97); } }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, .tab:focus-visible, .row-link:focus-visible { outline: 2px solid var(--ink-deep); outline-offset: 3px; }
.btn--gold { background: radial-gradient(64% 64% at 50% 100%, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 100%), var(--gold); }
.btn--neutral { background: radial-gradient(100% 100% at 50% 100%, #fff 0%, rgba(255,255,255,0) 100%), var(--surface-neutral); }
.btn--ghost { background: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; font-size: 15px; }
.btn--sm { font-size: 14px; min-height: 40px; padding: 8px 18px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn .spinner { width: 18px; height: 18px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; cursor: pointer;
  background: radial-gradient(100% 100% at 50% 100%, #fff 0%, rgba(255,255,255,0) 100%), var(--surface-neutral);
  box-shadow: var(--shadow-button); color: var(--ink); flex: none; transition: transform 300ms;
}
.icon-btn:active { transform: scale(0.94); }
.icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Поля ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; color: var(--ink); }
.input, select.input, textarea.input {
  width: 100%; min-height: 52px; border: 0; border-radius: var(--radius-md); background: var(--surface-input);
  padding: 0 24px; font: 16px var(--font-sans); color: var(--ink); appearance: none;
}
textarea.input { padding: 14px 24px; min-height: 110px; resize: vertical; line-height: 1.45; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234F4F4F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 22px center; padding-right: 44px; }
.input::placeholder { color: var(--ink-muted); }
.input:focus { outline: 2px solid var(--sky); }
.input[aria-invalid="true"] { outline: 2px solid var(--danger); }
.input--lg { font-size: 22px; min-height: 60px; text-align: center; letter-spacing: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--gold-deep); flex: none; }

/* ---------- Карточки и чипы ---------- */
.card { background: var(--surface); border-radius: var(--radius-md); padding: var(--space-3); border: 1px solid var(--line-hairline); }
.card--soft { background: var(--surface-soft); border: 0; }
.chip {
  border: 0; border-radius: var(--radius-pill); padding: 7px 16px; font: 14px var(--font-sans); color: var(--ink-deep);
  background: var(--surface-soft); cursor: pointer; white-space: nowrap; min-height: 36px;
}
.chip[aria-pressed="true"] { background: var(--gloss), var(--sky); box-shadow: var(--shadow-button); }
.chip--static { cursor: default; font-size: 12px; padding: 4px 12px; min-height: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; }
.chips--scroll::-webkit-scrollbar { display: none; }

.badge { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface-soft); color: var(--ink-deep); white-space: nowrap; }
.badge--gold { background: var(--gold); }
.badge--sky { background: var(--sky); }
.badge--neutral { background: var(--surface-neutral); }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface-neutral); border-top-color: var(--gold-deep); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Тосты и модалки ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 96px; display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink-deep); color: #fff; padding: 12px 20px; border-radius: var(--radius-pill); font-size: 14px; box-shadow: var(--shadow-pop); max-width: 460px; pointer-events: auto; animation: rise 300ms ease; }
.toast--error { background: var(--danger); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(16,39,54,.35); display: grid; place-items: center; z-index: 90; padding: 20px; animation: fade 200ms; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--radius-md); padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow-pop); display: grid; gap: 16px; max-height: 90vh; overflow: auto; }
.modal--wide { max-width: 760px; }

/* ---------- Декоративные линии: всегда под контентом ---------- */
.lines { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.lines img { position: absolute; left: 0; width: 100%; height: auto; }
.over-lines { position: relative; z-index: 1; }

.stack { display: grid; gap: var(--space-3); }
.stack-sm { display: grid; gap: var(--space-1); }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.empty { text-align: center; color: var(--ink-muted); padding: 40px 10px; display: grid; gap: 14px; justify-items: center; }
.empty .icon { width: 40px; height: 40px; color: var(--line-soft); }
.notice { background: var(--surface-soft); border-radius: var(--radius-sm); padding: 14px 18px; font-size: 14px; }
.notice--gold { background: #F6F0E6; }
.notice--error { background: #FBEFED; color: var(--danger); }
hr.sep { border: 0; border-top: 1px solid var(--line-hairline); margin: 0; }
