/* ХАККА — дизайн-система (общая). Страничные стили: site.css, auth.css, cabinet.css */
:root {
  --navy: #0D3358;
  --navy-hover: #0A2846;
  --orange: #F29F1B;
  --danger: #D92D20;        /* ошибки: подписи, рамки полей, предупреждения */
  --danger-bg: #FEF3F2;
  --orange-hover: #E0900F;
  --white: #FFFFFF;
  --surface: #F5F7FA;
  --border: #E3E8EF;
  --muted: #5B6B7F;
  --on-dark: rgba(255, 255, 255, .8);
  --on-dark-muted: rgba(255, 255, 255, .7);
  --on-dark-border: rgba(255, 255, 255, .2);
  --radius: 12px;
  --radius-btn: 10px;
  --radius-sm: 8px;
  --font: Onest, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --container: 1200px;
  --section-y: clamp(72px, 9vw, 120px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--white); color: var(--navy);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
a { color: var(--navy); text-decoration: none; transition: color .15s; }
a:hover { color: var(--orange); }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-y) 0; }
.section--surface { background: var(--surface); }
.section--navy { background: var(--navy); color: var(--white); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.muted { color: var(--muted); }

/* ---------- Typography ---------- */
.h1 { font-size: clamp(40px, 6.4vw, 84px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
.h2 { font-size: clamp(32px, 3.6vw, 48px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 14px; font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.caption { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.label { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 28px; border-radius: var(--radius-btn); border: 1px solid transparent;
  font-family: var(--font); font-size: 16px; font-weight: 600; line-height: 1; white-space: nowrap;
  background: transparent; color: var(--navy); cursor: pointer; text-decoration: none;
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
}
.btn:hover { color: inherit; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn--cta { background: var(--orange); color: var(--navy); font-weight: 700; }
.btn--cta:hover { background: var(--orange-hover); color: var(--navy); }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-hover); color: var(--white); }
.btn--outline { border-color: var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--surface); color: var(--navy); }
.btn--outline-light { border-color: rgba(255,255,255,.6); color: var(--white); }
.btn--outline-light:hover { border-color: var(--white); background: rgba(255,255,255,.08); color: var(--white); }
.btn--white { background: var(--white); color: var(--navy); }
.btn--white:hover { background: var(--surface); color: var(--navy); }
.btn--secondary { border-color: var(--border); background: var(--white); color: var(--navy); }
.btn--secondary:hover { background: var(--surface); color: var(--navy); }
.btn--lg { height: 60px; font-size: 17px; }
.btn--md { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn--xs { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn--block { width: 100%; }
.btn--link { height: auto; padding: 0; border: 0; font-weight: 600; gap: 8px; transition: gap .2s, color .15s; }
.btn--link:hover { gap: 14px; color: var(--orange); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .label { display: block; }
.input, .select, .textarea {
  width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--white); color: var(--navy); font-family: var(--font); font-size: 16px; outline: none;
  transition: border-color .15s;
}
.input::placeholder, .textarea::placeholder { color: #9AA6B5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy); outline: none; }
.input--lg { height: 60px; }
.input--md { height: 44px; font-size: 15px; }
.input[readonly] { background: var(--surface); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); background-color: var(--danger-bg); }
.textarea { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230D3358' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field-error { font-size: 13px; color: var(--danger); font-weight: 500; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap__btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px; color: var(--muted); display: flex; }
.input-wrap__btn:hover { color: var(--navy); }

.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; line-height: 1.45; }
.checkbox input { appearance: none; -webkit-appearance: none; flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; border: 1px solid var(--border); border-radius: 5px; background: var(--white); cursor: pointer; display: grid; place-content: center; transition: background .15s, border-color .15s; }
.checkbox input:checked { background: var(--navy); border-color: var(--navy); }
.checkbox input:checked::after { content: ''; width: 10px; height: 6px; border: 1.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.checkbox input:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Сегмент-переключатель */
.segment { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); }
.segment__btn { border: 0; background: transparent; padding: 8px 14px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; white-space: nowrap; }
.segment__btn.is-active { background: var(--navy); color: var(--white); }
.segment--block { display: flex; }
.segment--block .segment__btn { flex: 1; }

/* Toggle */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 40px; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 11px; background: var(--border); transition: background .2s; }
.toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--navy); }
.toggle input:checked + span::after { transform: translateX(18px); }

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card--lg { padding: 28px; }
.card--navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.card--hover { transition: border-color .2s; }
.card--hover:hover { border-color: var(--navy); }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 7px; background: var(--surface); font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--navy); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }
.badge--accent::before { background: var(--orange); }
.badge--plain::before { display: none; }

/* ---------- Progress 5 stages ---------- */
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.stage { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; position: relative; font-size: 13px; color: var(--muted); padding-right: 8px; }
.stage__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--border); position: relative; z-index: 1; }
.stage::before { content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--border); }
.stage:last-child::before { right: auto; width: 14px; }
.stage.is-done { color: var(--navy); }
.stage.is-done .stage__dot, .stage.is-done::before { background: var(--navy); }
.stage.is-current { color: var(--navy); font-weight: 600; }
.stage.is-current .stage__dot { background: var(--orange); }
@media (max-width: 640px) {
  .stages { grid-template-columns: 1fr; gap: 14px; }
  .stage { flex-direction: row; align-items: center; }
  .stage::before { top: 14px; bottom: -14px; left: 6px; right: auto; width: 2px; height: auto; }
  .stage:last-child::before { display: none; }
}

/* ---------- Vertical history ---------- */
.history { list-style: none; margin: 0; padding: 0; }
.history__item { position: relative; padding: 0 0 22px 26px; }
.history__item::before { content: ''; position: absolute; left: 4px; top: 14px; bottom: -2px; width: 1px; background: var(--border); }
.history__item:last-child::before { display: none; }
.history__dot { position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--navy); background: var(--white); }
.history__item:first-child .history__dot { background: var(--navy); }
.history__meta { font-size: 13px; color: var(--muted); }
.history__title { font-size: 15px; font-weight: 500; margin-top: 2px; }

/* ---------- FAQ accordion ---------- */
.faq { border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; border: 0; background: none; text-align: left; font-size: 18px; font-weight: 600; color: var(--navy); }
.faq__q svg { transition: transform .25s; }
.faq__q[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq__a { padding: 0 0 22px; font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 680px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--surface); padding: 12px 20px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.table td { padding: 14px 20px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface); }
.table--wide { min-width: 820px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Empty / skeleton / loader ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 56px 24px; text-align: center; color: var(--muted); }
.empty svg { color: var(--navy); }
.skeleton { background: var(--border); border-radius: 6px; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.speed-loader path { animation: speed 1s ease-in-out infinite; }
.speed-loader path:nth-child(2) { animation-delay: .15s; }
.speed-loader path:nth-child(3) { animation-delay: .3s; }
@keyframes speed { 0% { transform: translateX(-100%); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }

/* ---------- Alerts ---------- */
.notice { border: 1px solid var(--navy); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; background: var(--white); }
.notice--error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.notice--error a { color: var(--danger); text-decoration: underline; }
.notice--error a:hover { color: var(--navy) !important; }
.notice--muted { border-color: var(--border); background: var(--surface); }

/* ---------- Links with speed lines ---------- */
.speed-link { display: inline-flex; flex-direction: column; gap: 5px; }
.speed-link__lines { display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .2s; }
.speed-link__lines span { height: 1px; background: currentColor; }
.speed-link__lines span:nth-child(1) { width: 100%; }
.speed-link__lines span:nth-child(2) { width: 65%; }
.speed-link__lines span:nth-child(3) { width: 35%; }
.speed-link:hover .speed-link__lines, .speed-link.is-active .speed-link__lines { opacity: 1; }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s ease-out, transform .6s ease-out; }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- WhatsApp float ---------- */
.wa-float { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; background: var(--navy); color: var(--white); display: grid; place-items: center; transition: background .2s; }
.wa-float:hover { background: var(--navy-hover); color: var(--white); }

/* Mobile: поля и кнопки на всю ширину */
@media (max-width: 640px) {
  .btn-row-mobile > .btn { width: 100%; }
}
