/* Elite Academy — модуль оферты. Палитра и типографика взяты из tokens.css основного сайта. */

:root {
  --navy: #064066;
  --navy-2: #074C7A;
  --navy-deep: #01182d;
  --blue: #1A5E90;
  --blue-2: #4A8FC7;
  --accent: #7BB5DC;
  --accent-soft: #E1EEF7;
  --white: #fff;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-700: #334155;
  --text: #1E293B;
  --muted: #64748B;
  --line: rgba(6, 64, 102, 0.10);
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --ok: #15803D;
  --ok-bg: #ECFDF3;
  --warn: #B54708;
  --warn-bg: #FFFAEB;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-head: 'Raleway', 'DM Sans', system-ui, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(6, 64, 102, .06);
  --shadow-md: 0 14px 40px -12px rgba(6, 64, 102, .18);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; line-height: 1.62; }
a { color: var(--blue); }
button { font-family: inherit; cursor: pointer; border: none; }

.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(1, 24, 45, .96);
  backdrop-filter: blur(10px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.topbar-in { display: flex; align-items: center; gap: 12px; padding: 12px 16px; max-width: 780px; margin: 0 auto; }
.brand { font-family: var(--font-head); font-weight: 900; font-size: 15px; letter-spacing: .04em; }
.brand span { color: var(--accent); }
.doc-no { margin-left: auto; font-size: 11px; color: var(--accent); letter-spacing: .04em; }
.progress-line { height: 3px; background: rgba(255, 255, 255, .12); }
.progress-line > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #fff); transition: width .4s var(--ease); }

/* ---------- герой ---------- */
.hero { background: linear-gradient(160deg, var(--navy-deep), var(--navy-2)); color: #fff; padding: 34px 0 78px; }
.hero h1 { font-size: clamp(22px, 5.4vw, 32px); }
.hero .lead { margin-top: 12px; color: #C9E2F3; font-size: 15px; }
.pill { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); font-size: 12px; letter-spacing: .04em; margin-bottom: 14px; }

/* ---------- карточки условий ---------- */
.summary { margin-top: -58px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.sum-card { background: #fff; border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.sum-card b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.sum-card span { display: block; margin-top: 5px; font-size: 14.5px; font-weight: 600; font-family: var(--font-head); }
.sum-card.alert { background: var(--danger-bg); border-color: #FDA29B; }
.sum-card.alert span { color: var(--danger); }

/* ---------- секции-шаги ---------- */
.step { background: #fff; border-radius: var(--r-lg); padding: 22px; margin-top: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.step-num { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.step h2 { font-size: 18px; }
.step .hint { color: var(--muted); font-size: 13.5px; margin: 8px 0 16px; }

/* ---------- форма ---------- */
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.field label i { color: var(--danger); font-style: normal; }
.field input {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit; color: var(--text);
  border: 1.5px solid var(--gray-200); border-radius: var(--r-sm); background: var(--gray-50);
  transition: border-color .2s, background .2s;
}
.field input:focus { outline: none; border-color: var(--blue); background: #fff; }
.field input.bad { border-color: #FDA29B; background: var(--danger-bg); }
.field .err { display: none; color: var(--danger); font-size: 12px; margin-top: 4px; }
.field.show-err .err { display: block; }

/* ---------- текст оферты ---------- */
.doc-section { border-top: 1px solid var(--gray-200); padding: 20px 0 4px; }
.doc-section:first-of-type { border-top: none; padding-top: 4px; }
.doc-section h3 { font-size: 15.5px; color: var(--navy); margin-bottom: 10px; }
.doc-section p { font-size: 14.2px; color: var(--gray-700); margin-bottom: 9px; }
.doc-section.critical h3 { color: var(--danger); }
.doc-section.critical { background: linear-gradient(180deg, var(--danger-bg), #fff); border-radius: var(--r-md); padding: 18px 16px 6px; margin-top: 14px; border: 1px solid #FEE4E2; }

/* ---------- чекбоксы ---------- */
.ack {
  display: flex; gap: 12px; align-items: flex-start; margin: 12px 0 4px;
  padding: 13px 14px; border-radius: var(--r-md); background: var(--gray-50);
  border: 1.5px solid var(--gray-200); cursor: pointer; transition: all .2s var(--ease);
}
.ack:hover { border-color: var(--accent); }
.ack.locked { opacity: .55; cursor: default; }
.ack.locked:hover { border-color: var(--gray-200); }
.ack.checked { background: var(--ok-bg); border-color: #A6F4C5; }
.ack input { appearance: none; margin: 1px 0 0; width: 22px; height: 22px; flex: none; border: 2px solid var(--gray-400); border-radius: 6px; background: #fff; cursor: pointer; position: relative; transition: all .15s; }
.ack input:checked { background: var(--ok); border-color: var(--ok); }
.ack input:checked::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.ack input:disabled { cursor: not-allowed; background: var(--gray-200); border-color: var(--gray-300); }
.ack .ack-text { font-size: 14px; line-height: 1.5; font-weight: 500; }
.ack .lock-note { display: none; font-size: 11.5px; color: var(--warn); margin-top: 5px; }
.ack.locked .lock-note { display: block; }
.ack.critical { background: var(--danger-bg); border-color: #FDA29B; }
.ack.critical.checked { background: var(--ok-bg); border-color: #A6F4C5; }

/* ---------- подпись ---------- */
.sign-pad { position: relative; margin-top: 8px; border: 2px dashed var(--gray-300); border-radius: var(--r-md); background: var(--gray-50); touch-action: none; overflow: hidden; }
.sign-pad canvas { display: block; width: 100%; height: 170px; touch-action: none; }
.sign-pad.filled { border-style: solid; border-color: var(--accent); background: #fff; }
.sign-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gray-400); font-size: 13.5px; pointer-events: none; }
.sign-pad.filled .sign-ph { display: none; }
.sign-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.link-btn { background: none; color: var(--blue); font-size: 13px; font-weight: 600; padding: 4px 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff;
  box-shadow: 0 14px 36px -10px rgba(26, 94, 144, .5); transition: transform .15s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--gray-300); box-shadow: none; }

/* ---------- нижняя панель ---------- */
.bottombar { position: sticky; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--gray-200); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); margin-top: 22px; }
.bottombar-in { display: flex; align-items: center; gap: 14px; max-width: 780px; margin: 0 auto; padding: 0 16px; }
.bottombar .cnt { font-size: 13px; color: var(--muted); font-weight: 600; }
.bottombar .cnt b { color: var(--navy); }
.bottombar .btn { margin-left: auto; padding: 12px 20px; font-size: 14px; }

/* ---------- служебное ---------- */
.msg { padding: 12px 14px; border-radius: var(--r-sm); font-size: 13.5px; margin-top: 14px; display: none; }
.msg.show { display: block; }
.msg.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #FDA29B; }
.msg.info { background: var(--accent-soft); color: var(--navy); border: 1px solid var(--accent); }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 13px; }
.footer { padding: 26px 16px 40px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ---------- финальный экран ---------- */
.done { background: #fff; border-radius: var(--r-lg); padding: 30px 22px; margin-top: 18px; text-align: center; box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.done .tick { width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 32px; }
.done h2 { font-size: 21px; }
.done .meta { margin-top: 16px; background: var(--gray-50); border-radius: var(--r-md); padding: 14px; text-align: left; font-size: 13px; }
.done .meta div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--gray-200); }
.done .meta div:last-child { border: none; }
.done .meta span:first-child { color: var(--muted); }
.done .meta span:last-child { font-weight: 600; text-align: right; word-break: break-all; }

.skeleton { padding: 60px 0; text-align: center; color: var(--muted); }

@media (max-width: 520px) {
  .step { padding: 18px 15px; border-radius: var(--r-md); }
  .hero { padding: 26px 0 70px; }
}
