/* МАРТИ — фирменный стиль сайта marti.games.
 * Палитра и типографика — те же токены, что в приложении
 * (app/lib/app/theme/color_tokens.g.dart, app_text_styles.dart):
 * кремовый фон, оранжевый акцент, жёлтые кнопки с чёрной рамкой и жёсткой
 * тенью, Montserrat 400/600. Шрифт раздаётся с нашего сервера — без внешних
 * CDN (посетитель не «светится» у третьих лиц). */

@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/Montserrat-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/Montserrat-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg-primary: #ffffff;
  --bg-light: #f5f5f5;
  --bg-accent: #fff5e3;
  --surface-primary: #dfdfd5;
  --surface-muted: #f2f2e6;
  --surface-inverse: #000000;
  --text-default: #000000;
  --text-invert: #ffffff;
  --text-muted: #50534e;
  --text-caption: #8a8a8a;
  --text-accent: #e77123;
  --text-link: #cc6600;
  --text-error: #d52b1e;
  --border-primary: #50534e;
  --border-strong: #000000;
  --border-muted: #cbd1c7;
  --button-accent: #fbc02d;
  --status-success: #a7c6bc;
  --accent: #e77123;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-hard: 0 4px 0 var(--border-strong);
  --max: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-default);
  background: var(--bg-accent);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Шапка ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-accent);
  border-bottom: 2px solid var(--border-strong);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.logo {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.logo img {
  height: 34px;
  width: auto;
  display: block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-default);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
}
.nav a:hover,
.nav a[aria-current='page'] {
  background: var(--surface-muted);
  color: var(--text-default);
}

/* ── Кнопки (как MartiButton: жёлтая, чёрная рамка, жёсткая тень) ──── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 24px;
  font: 600 16px/1.2 'Montserrat', system-ui, sans-serif;
  color: var(--text-default);
  background: var(--button-accent);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:hover {
  color: var(--text-default);
}
.btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--border-strong);
}
.btn:disabled {
  background: #bfbebb;
  cursor: not-allowed;
  opacity: 0.8;
}
.btn--light {
  background: var(--bg-primary);
}
.btn--dark {
  background: var(--surface-inverse);
  color: var(--text-invert);
}
.btn--dark:hover {
  color: var(--text-invert);
}
.btn--danger {
  background: var(--bg-primary);
  color: var(--text-error);
  border-color: var(--text-error);
  box-shadow: 0 4px 0 var(--text-error);
}
.btn--danger:hover {
  color: var(--text-error);
}
.btn--block {
  width: 100%;
}
.btn--sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ── Карточки ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-primary);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard);
  padding: 28px;
}
.card--muted {
  background: var(--surface-muted);
}

/* ── Типографика ───────────────────────────────────────────────────── */
h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(32px, 5vw, 48px);
}
h2 {
  font-size: clamp(22px, 3vw, 28px);
}
h3 {
  font-size: 20px;
}
.accent {
  color: var(--text-accent);
}
.muted {
  color: var(--text-muted);
}
.caption {
  font-size: 13px;
  color: var(--text-caption);
}
.lead {
  font-size: 18px;
  color: var(--text-muted);
}

/* ── Главная ───────────────────────────────────────────────────────── */
.hero {
  padding: 56px 0 40px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}
.hero__mascot {
  justify-self: center;
  max-width: 360px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.08));
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.store-note {
  margin-top: 12px;
}

.section {
  padding: 40px 0;
}
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.feature {
  background: var(--bg-primary);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 22px;
}
.feature__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--button-accent);
  border: 2px solid var(--border-strong);
  margin-bottom: 14px;
}
.feature p {
  margin: 0;
  color: var(--text-muted);
}

.cta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}
.cta img {
  width: 160px;
}

/* ── Формы ─────────────────────────────────────────────────────────── */
.form-page {
  padding: 40px 0 64px;
}
.form-card {
  max-width: 480px;
  margin: 0 auto;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.field label {
  font-weight: 600;
  font-size: 14px;
}
.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  font: 400 18px/1.2 'Montserrat', system-ui, sans-serif;
  color: var(--text-default);
  background: var(--bg-primary);
  border: 2px solid #8a8a8a;
  border-radius: var(--radius-lg);
  outline: none;
}
.input:focus {
  border-color: var(--border-strong);
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-muted);
}
.check input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.call-number {
  display: block;
  text-align: center;
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-default);
  text-decoration: none;
  padding: 18px 12px;
  margin: 18px 0;
  background: var(--bg-accent);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-xl);
}
.steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text-muted);
}
.steps li {
  margin-bottom: 6px;
}
.waiting {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  margin: 12px 0 20px;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--surface-primary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0 0 24px;
}
.kv dt {
  color: var(--text-muted);
}
.kv dd {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}
.stack {
  display: grid;
  gap: 14px;
}
.divider {
  border: 0;
  border-top: 2px solid var(--surface-primary);
  margin: 24px 0;
}

.banner {
  max-width: 480px;
  margin: 0 auto 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-strong);
  font-size: 15px;
}
.banner--error {
  background: #fde8e6;
  border-color: var(--text-error);
  color: #8f1c13;
}
.banner--info {
  background: #e6f0ec;
  border-color: #5f8f80;
}

/* ── Модалка ───────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
}
.modal[hidden] {
  display: none;
}
.modal__box {
  max-width: 440px;
  width: 100%;
}
.modal__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.modal__actions .btn {
  flex: 1 1 160px;
}

/* ── Поддержка ─────────────────────────────────────────────────────── */
.support-mail {
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 600;
  word-break: break-all;
}
.faq details {
  background: var(--bg-primary);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 12px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
}
.faq p {
  margin: 10px 0 0;
  color: var(--text-muted);
}

/* ── Подвал ────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 40px;
  padding: 32px 0 40px;
  background: var(--surface-inverse);
  color: #cfcfc8;
  font-size: 14px;
}
.site-footer a {
  color: var(--text-invert);
}
.site-footer a:hover {
  color: var(--button-accent);
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer__org {
  max-width: 460px;
  color: #a5a59f;
}

/* ── Юридические документы ─────────────────────────────────────────── */
.doc {
  max-width: 820px;
  margin: 32px auto 0;
  background: var(--bg-primary);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 44px);
}
.doc h1 {
  font-size: clamp(24px, 3.4vw, 32px);
}
.doc h2 {
  font-size: 20px;
  margin-top: 32px;
}
.doc p,
.doc li {
  color: #222;
}
.doc ul {
  padding-left: 20px;
}
.doc li {
  margin-bottom: 6px;
}
.doc__org {
  color: var(--text-muted);
  font-size: 14px;
}
.doc__meta {
  color: var(--text-caption);
  font-size: 14px;
}
.doc-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.doc-list a {
  display: block;
  padding: 16px 18px;
  font-weight: 600;
  color: var(--text-default);
  text-decoration: none;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-accent);
}
.doc-list a:hover {
  background: var(--button-accent);
}

/* ── Адаптив ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .hero {
    padding: 32px 0 24px;
  }
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__mascot {
    order: -1;
    max-width: 220px;
  }
  .cta {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cta img {
    margin: 0 auto;
    width: 130px;
  }
  .nav {
    flex-wrap: nowrap;
    gap: 2px;
  }
  .nav__extra {
    display: none;
  }
  .nav a {
    padding: 6px 7px;
    font-size: 13px;
    white-space: nowrap;
  }
  .logo img {
    height: 24px;
  }
  .site-header__row {
    min-height: 60px;
    gap: 8px;
  }
  .card {
    padding: 22px;
  }
}
