/* Onlink waitlist landing — single-screen marketing page.
 * The modal that pops on the CTA mirrors the cabinet's dialog
 * language (ChangeEmailDialog / ChangePasswordDialog): centered icon
 * + title, h-8 muted inputs, vertical full-width buttons.
 */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b7280;
  --muted-soft: #9ca3af;
  --border: #e5e7eb;
  --border-soft: rgba(229, 231, 235, 0.5);     /* matches border-border/50 */
  --field-bg: rgba(243, 244, 246, 0.5);        /* matches bg-muted/10 */
  --accent: #2bb14e;
  --accent-hover: #259843;
  --shadow-focus: 0 0 0 4px rgba(43, 177, 78, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Kill the vertical rubber-band / "bounce" overscroll so the page
     can't be dragged past the footer to reveal the white canvas
     underneath it. `-y` only — leaves the horizontal two-finger
     back/forward trackpad gesture (overscroll-behavior-x) intact.
     Applied to both html and body because browsers disagree on which
     one owns the document scroll. */
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100svh;
}

.screen {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-width: 1120px;
  margin: 0 auto;
}

/* ── Hero ──────────────────────────────────────────────────────────── */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 0;
  gap: 24px;
  animation: fade-up 600ms ease-out both;
}

.hero__mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.25rem, 5vw + 1rem, 4.25rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.hero__cycle {
  margin: 0;
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--muted);
  min-height: 1.6em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  flex-wrap: wrap;
  justify-content: center;
}

.hero__cycle-text {
  color: var(--fg);
  display: inline-block;
  transition: opacity 320ms ease, transform 320ms ease;
}

.hero__cycle-text.is-leaving {
  opacity: 0;
  transform: translateY(-12px);
}

.hero__cycle-text.is-entering {
  opacity: 0;
  transform: translateY(12px);
}

/* ── CTA on the hero ──────────────────────────────────────────────── */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  margin-top: 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 160ms ease, transform 80ms ease;
}

.cta:hover { background: var(--accent-hover); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ── Modal shell ───────────────────────────────────────────────────── */

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modal-fade 180ms ease-out both;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal__card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 16px 24px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: modal-pop 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Modal header — mirrors DialogHeader.flex.flex-col.items-center
   .pb-2.pt-4 in the cabinet. */

.modal__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 8px;
  text-align: center;
}

.modal__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  color: var(--muted);
  opacity: 0.2;
}

.modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg);
}

.modal__lede {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ── Form / fields — h-8 muted inputs to match cabinet dialogs ────── */

.form {
  display: flex;
  flex-direction: column;
  padding-top: 24px;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(107, 114, 128, 0.7);     /* text-muted-foreground/70 */
  letter-spacing: 0;
}

.field__input {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--fg);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field__input::placeholder {
  color: var(--muted-soft);
}

.field__input:focus {
  border-color: var(--accent);
}

.field__input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form__status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: left;
}

.form__status.is-success {
  color: var(--accent);
}

.form__status.is-error {
  color: #dc2626;
}

/* Honeypot — visually hidden but still focusable from the DOM. */
.form__honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Actions — vertical w-full stack, primary on top, ghost below ── */

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 80ms ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn--ghost {
  background: rgba(243, 244, 246, 0.7);   /* light gray fill */
  color: var(--muted);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(229, 231, 235, 0.9);   /* slightly darker on hover */
  color: var(--fg);
}

/* ── Mobile ────────────────────────────────────────────────────────── */

@media (max-width: 540px) {
  .screen {
    padding: 16px;
  }

  .hero {
    padding: 32px 0;
    gap: 20px;
  }

  .modal__card {
    padding: 16px 20px 20px;
  }
}

/* ── Animations ────────────────────────────────────────────────────── */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .modal,
  .modal__card {
    animation: none;
  }
  .hero__cycle-text {
    transition: none;
  }
}

/* ── Legal pages (Оферта / Возврат / Privacy) ─────────────────────
 * Простой article-layout: топбар с «Назад на главную», title +
 * subtitle, секции по h2. Цель — Apple ревьюер + Halyk комплаенс
 * видят рабочий публичный документ с реквизитами ТОО, привязанными
 * к домену.
 */

.legal {
  max-width: 760px;
  padding: 24px;
}

.legal__topbar {
  padding: 16px 0 8px;
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  margin-left: -12px;
  border-radius: var(--radius-sm);
  transition: color 150ms ease, background 150ms ease;
}

.legal__back:hover,
.legal__back:focus-visible {
  color: var(--fg);
  background: var(--field-bg);
}

.legal__article {
  padding: 32px 0 64px;
  animation: fade-up 500ms ease-out both;
}

.legal__title {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.legal__subtitle {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--muted);
}

.legal__meta {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted-soft);
}

.legal__note {
  margin: 0 0 32px;
  padding: 16px 18px;
  background: rgba(43, 177, 78, 0.06);
  border: 1px solid rgba(43, 177, 78, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg);
}

.legal__note strong {
  display: inline-block;
  margin-right: 4px;
  font-weight: 600;
}

.legal__section {
  margin-top: 32px;
}

.legal__section h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.legal__section p,
.legal__section li {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.65;
  color: #1f2937;
}

.legal__section ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.legal__section li {
  margin-bottom: 6px;
}

.legal__section strong {
  font-weight: 600;
  color: var(--fg);
}

.legal__section a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(43, 177, 78, 0.2);
  transition: border-color 150ms ease;
}

.legal__section a:hover {
  border-bottom-color: var(--accent);
}

/* ── Footer ─────────────────────────────────────────────────────────
 * Light-gray strip with three columns: бренд + copyright, легальные
 * документы, контакты. На мобильнике колонки стекаются в столбец.
 * Цель — публично продемонстрировать связь домена onlink.kz с
 * юр.лицом ТОО «АЗАТОРА» (требование Apple Developer review + Halyk
 * ePay). Высота не фиксируется, растёт под контент.
 *
 * Дизайн-токены берутся из :root в начале файла. --footer-bg чуть
 * мягче чем --field-bg чтобы footer не сливался с инпутами модалки.
 */

.footer {
  margin-top: auto;
  background: #f3f4f6;
  border-top: 1px solid var(--border);
  padding: 40px 24px 32px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 48px;
  /* stretch — чтобы все колонки заняли одинаковую высоту; это
     позволяет копирайту прилипнуть к низу через justify-content
     space-between в .footer__brand (см. ниже). */
  align-items: stretch;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__brand {
  gap: 12px;
  /* space-between прижимает copyright к нижнему краю колонки, на
     одной горизонтали с последней строкой адреса в правой колонке. */
  justify-content: space-between;
}

/* Brand-row — лого + ONLINK wordmark рядом. Совпадает с навбаром
   веб-кабинета (см. Layout.tsx): img 32px, gap 10px, bold tracking
   −0.01em. */
.footer__brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.footer__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.footer__wordmark {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1;
}

/* Entity-name справа: визуально работает как заголовок (как
   .footer__heading в центральной колонке), но семантически — это
   часть address-блока. */
.footer__entity {
  /* margin: 0 — отступ от entity-имени до адреса даёт column-level
     `gap: 12px` (см. .footer__col). Сведено к .footer__heading чтобы
     первая строка БИН на той же высоте что первый item в legal-списке. */
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
}

/* Copyright — единственная строка в левой колонке после удаления
   tagline'а. Шрифт/цвет сведены к тому же что .footer__address и
   .footer__list (13 px, --muted) чтобы три колонки визуально были
   одного веса. */
.footer__copy {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.footer__heading {
  /* margin: 0 — отступ от заголовка к контенту даёт column-level
     `gap: 12px` (см. .footer__col). Точно совпадает с .footer__entity,
     поэтому первая строка контента в средней и правой колонках
     стоит на одной горизонтали. */
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  /* gap 7px — sweet spot между разреженным 8 и тесным 4–6. */
  gap: 7px;
}

.footer__link {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.footer__link:hover,
.footer__link:focus-visible {
  color: var(--accent);
}

.footer__address {
  margin: 0;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

.footer__address strong {
  color: var(--fg);
  font-weight: 600;
}

/* Placeholder-attributed spans/links — оставляем визуально серыми
   чтобы было видно что данные ещё не заполнены. Когда поставишь
   точные значения — атрибут можно убрать. */
[data-placeholder] {
  color: var(--muted-soft);
  font-style: italic;
}

/* Mobile: стекаем колонки */
@media (max-width: 720px) {
  .footer {
    padding: 32px 20px 28px;
  }
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer__brand {
    gap: 10px;
  }
}

/* Screen container не должен «выталкивать» footer вниз — у нас
   уже flex:1 на .hero. Делаем body/.screen чтобы footer прилипал
   к низу когда контента мало (sticky-footer pattern). */
.screen {
  /* override min-height и flex чтобы footer был отдельно от .screen */
  min-height: auto;
}

body {
  display: flex;
  flex-direction: column;
}

body > .screen {
  flex: 1 0 auto;
  min-height: calc(100vh - 1px);
  min-height: calc(100svh - 1px);
}

body > .footer {
  flex-shrink: 0;
}
