/* ═══════════════════════════════════════════════
   РемФон — «Верстак инженера»
   Токены см. DESIGN.md. Белый верстак, сталь,
   mono-цифры, зелёный только для «готово».
   ═══════════════════════════════════════════════ */
:root {
  --bg: #ffffff;
  --surface: #f4f7f9;
  --steel: #33566e;
  --steel-deep: #22394a;
  --ink: #141c22;
  --muted: #5b6a75;
  --hairline: #dde5ea;
  --ready: #177245;
  --danger: #b3261e;

  --ff-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --ff-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --r-sm: 6px;
  --r-md: 10px;

  --shadow-float: 0 8px 28px -12px rgba(20, 28, 34, 0.18);
  --shadow-card-hover: 0 2px 10px -4px rgba(20, 28, 34, 0.10);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--steel); }

.mono {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 {
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { max-width: 68ch; }
.muted { color: var(--muted); }

/* ── Кнопки ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px 28px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--ff-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary { background: var(--steel); color: #fff; }
.btn-primary:hover { background: var(--steel-deep); }
.btn-ghost { background: transparent; color: var(--steel); border-color: var(--steel); }
.btn-ghost:hover { background: var(--surface); }
.btn-ready { background: var(--ready); color: #fff; } /* только «Готов к выдаче» */
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

/* ── Шапка ──────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--steel);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  font-weight: 600;
}
.nav { display: flex; gap: 26px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 0;
}
.nav a:hover { color: var(--ink); }
.header .btn { min-height: 40px; padding: 8px 18px; font-size: 0.92rem; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ───────────────────────────────────── */
.hero { padding: 88px 0 64px; }
.hero .eyebrow-line {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  color: var(--steel);
  margin-bottom: 20px;
}
.hero h1 { max-width: 17ch; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--steel); }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; color: var(--muted); }
.trust-item .tick { color: var(--ready); font-weight: 700; } /* гарантия = подтверждено = зелёный по правилу */

/* ── Секции ─────────────────────────────────── */
.section { padding: 88px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.section-head { margin-bottom: 44px; }
.section-head .kicker {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  color: var(--steel);
  display: block;
  margin-bottom: 10px;
}
.section-head p { color: var(--muted); margin-top: 10px; }

/* ── Конфигуратор ───────────────────────────── */
.calc {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg);
  overflow: hidden;
}
.calc-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.calc-col { padding: 26px; border-right: 1px solid var(--hairline); min-width: 0; }
.calc-col:last-child { border-right: none; }
.calc-col-title {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 16px;
}
.calc-col-title .n {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.calc-col-title h3 { font-size: 1.02rem; }
.opts { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.opt {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  min-height: 46px;
  font-family: var(--ff-sans);
  font-size: 0.98rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.opt:hover { border-color: var(--steel); box-shadow: var(--shadow-card-hover); }
.opt[aria-pressed="true"] {
  border: 2px solid var(--steel);
  background: var(--surface);
  padding: 11px 13px;
  font-weight: 600;
}
.opt .opt-price { font-family: var(--ff-mono); font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.opt-placeholder { color: var(--muted); font-size: 0.95rem; padding: 12px 2px; }

.calc-result {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  padding: 24px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.calc-summary { min-width: 0; }
.calc-summary .picked { color: var(--muted); font-size: 0.95rem; margin-bottom: 6px; }
.calc-price-line { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.calc-price {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 600;
  color: var(--ink);
}
.calc-meta { font-size: 0.92rem; color: var(--muted); }
.calc-note { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }

/* ── Как мы работаем ────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}
.step-cell { background: var(--bg); padding: 26px; }
.step-cell .sn {
  font-family: var(--ff-mono);
  color: var(--steel);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 12px;
}
.step-cell h3 { margin-bottom: 8px; font-size: 1.05rem; }
.step-cell p { font-size: 0.95rem; color: var(--muted); }

/* ── Трекинг ────────────────────────────────── */
.track-form { display: flex; gap: 10px; max-width: 460px; margin-bottom: 8px; }
.track-form input { flex: 1; }
.track-hint { font-size: 0.88rem; color: var(--muted); }
.track-card {
  margin-top: 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 26px;
  background: var(--bg);
}
.track-card .order-line {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  align-items: baseline;
  margin-bottom: 22px;
}
.track-card .order-num { font-family: var(--ff-mono); font-weight: 600; font-size: 1.2rem; }
.track-error { color: var(--danger); margin-top: 14px; font-size: 0.95rem; }

/* Степпер статусов */
.stepper { list-style: none; display: flex; flex-direction: column; gap: 0; }
.stepper li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  position: relative;
  padding-bottom: 22px;
}
.stepper li:last-child { padding-bottom: 0; }
.stepper .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  background: var(--bg);
  margin-top: 4px;
  justify-self: center;
}
.stepper li::before {
  content: '';
  position: absolute;
  left: 10px; top: 20px; bottom: 2px;
  width: 2px;
  background: var(--hairline);
}
.stepper li:last-child::before { display: none; }
.stepper .st-name { font-weight: 500; color: var(--muted); }
.stepper .st-time { font-family: var(--ff-mono); font-size: 0.8rem; color: var(--muted); }
.stepper li.done .dot { background: var(--steel); border-color: var(--steel); }
.stepper li.done .st-name { color: var(--ink); }
.stepper li.done::before { background: var(--steel); }
.stepper li.current .dot { border-color: var(--steel); background: var(--bg); box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 8px var(--steel); }
.stepper li.current .st-name { color: var(--ink); font-weight: 600; }
/* «Готов к выдаче» — единственный зелёный узел */
.stepper li.ready.done .dot, .stepper li.ready.current .dot { background: var(--ready); border-color: var(--ready); box-shadow: none; }
.stepper li.ready.current .st-name { color: var(--ready); }

/* ── Филиалы ────────────────────────────────── */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.branch-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 24px;
  background: var(--bg);
}
.branch-card h3 { margin-bottom: 10px; }
.branch-card p { font-size: 0.95rem; color: var(--muted); margin-bottom: 4px; }
.branch-card .mono { font-size: 0.92rem; color: var(--ink); }

/* ── Формы ──────────────────────────────────── */
input, select {
  font-family: var(--ff-sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  min-height: 48px;
  width: 100%;
  transition: border-color 0.15s var(--ease);
}
input:focus, select:focus { outline: none; border: 2px solid var(--steel); padding: 11px 14px; }
input.error { border: 2px solid var(--danger); padding: 11px 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.field .err { display: none; color: var(--danger); font-size: 0.85rem; margin-top: 5px; }
.field.has-error .err { display: block; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--muted); margin: 18px 0; }
.consent input { width: 18px; min-height: 18px; height: 18px; margin-top: 2px; accent-color: var(--steel); flex: 0 0 auto; }

/* ── Модалка записи ─────────────────────────── */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 28, 34, 0.5); }
.modal-card {
  position: relative;
  background: var(--bg);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
}
.modal-card h3 { margin-bottom: 6px; font-size: 1.35rem; }
.modal-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px;
  background: none; border: none;
  font-size: 1.5rem; color: var(--muted);
  cursor: pointer; border-radius: var(--r-sm);
}
.modal-close:hover { background: var(--surface); color: var(--ink); }
.order-summary {
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.order-summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.order-summary .row b { font-family: var(--ff-mono); font-weight: 600; }

/* Успех записи */
.success-box { text-align: center; padding: 12px 0; }
.success-box .ok-mark {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--ready);
  color: #fff;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
}
.success-box .big-num {
  font-family: var(--ff-mono);
  font-size: 2rem;
  font-weight: 600;
  margin: 10px 0 4px;
}
.success-box p { margin: 0 auto 8px; font-size: 0.95rem; color: var(--muted); }

/* ── Футер ──────────────────────────────────── */
.footer {
  background: var(--steel-deep);
  color: #c8d4dd;
  padding: 56px 0 28px;
  margin-top: 88px;
}
.footer a { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer p, .footer li { font-size: 0.92rem; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 20px;
  font-size: 0.85rem;
  color: #9fb2bf;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}
.demo-badge {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
}

/* ── Кабинет мастера ────────────────────────── */
.master-body { background: var(--surface); min-height: 100vh; }
.master-wrap { max-width: 860px; margin: 0 auto; padding: 24px; }
.master-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 22px; flex-wrap: wrap;
}
.login-card {
  max-width: 380px;
  margin: 10vh auto 0;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 30px;
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-card .muted { font-size: 0.92rem; margin-bottom: 20px; display: block; }
.login-err { color: var(--danger); font-size: 0.9rem; margin-top: 10px; display: none; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.seg {
  min-height: 44px;
  padding: 9px 16px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-family: var(--ff-sans);
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
}
.seg[aria-pressed="true"] { border: 2px solid var(--steel); color: var(--ink); font-weight: 600; padding: 8px 15px; }

.order-row {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.order-row .o-num { font-family: var(--ff-mono); font-weight: 600; }
.order-row .o-info { font-size: 0.95rem; color: var(--muted); }
.order-row .o-status {
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}
.order-row .o-status.is-ready { background: #e7f3ec; border-color: var(--ready); color: var(--ready); }
.order-row .o-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.order-row .btn { min-height: 48px; }
.empty-note { text-align: center; color: var(--muted); padding: 48px 0; }

/* ── Анимации появления (не гейтят контент) ──── */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .reveal.is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ── Адаптив ────────────────────────────────── */
@media (max-width: 900px) {
  .calc-steps { grid-template-columns: 1fr; }
  .calc-col { border-right: none; border-bottom: 1px solid var(--hairline); }
  .calc-col:last-child { border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  .nav {
    position: fixed;
    top: 64px; right: 0;
    width: min(78vw, 300px);
    height: calc(100vh - 64px);
    background: var(--bg);
    border-left: 1px solid var(--hairline);
    flex-direction: column;
    gap: 0;
    padding: 18px 22px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
  }
  .nav.open { transform: translateX(0); }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 1.02rem; }
  .nav-toggle { display: flex; }
  .header .header-cta { display: none; }
  .hero { padding: 56px 0 44px; }
  .section { padding: 60px 0; }
  .track-form { flex-direction: column; }
  .order-row { grid-template-columns: 1fr; }
  .order-row .o-actions { justify-content: stretch; }
  .order-row .o-actions .btn { flex: 1; }
}
