/* =========================================================================
   SmArt.Point × Yalla Lunch — квиз. Co-brand дизайн-система из колоды.
   Плоский статик: без сборки, без фреймворков.
   ========================================================================= */

/* ---- Manrope (variable, self-hosted) ---------------------------------- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('assets/manrope-cyrillic.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('assets/manrope-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('assets/manrope-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens ----------------------------------------------------------- */
:root {
  --purple: #6d28d9;
  --purple-bright: #7c3aed;
  --purple-deep: #4c1d95;
  --coral: #f97316;
  --coral-ink: #c2410c; /* тёмная коралловая для ТЕКСТА на светлом — контраст AA */
  --coral-soft: #fbeedd;

  --bg: #f5f4f0;
  --ink: #1a1a2e;
  --ink-2: #2a2a40;
  --muted: #63637a; /* затемнён с #8b8b9d → контраст ≥4.5:1 на фоне (AA) */

  --surface: #ffffff;
  --violet-tint: #ede9fb;
  --violet-tint-2: #f6f2ff;
  --violet-line: #e5e1f0;
  --violet-line-strong: #c4b5fd;

  --success: #1a8a45;
  --success-bg: #e4f5ea;
  --danger: #d64545;

  --text-eyebrow: clamp(0.68rem, 0.64rem + 0.2vw, 0.75rem);
  --text-title: clamp(1.6rem, 1.15rem + 2.6vw, 2.85rem);
  --text-lead: clamp(1rem, 0.94rem + 0.4vw, 1.15rem);
  --text-option: clamp(1rem, 0.96rem + 0.35vw, 1.12rem);

  --radius-card: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --tap: 56px;

  --shadow-sm: 0 1px 2px rgba(26, 19, 56, 0.06), 0 4px 12px rgba(26, 19, 56, 0.05);
  --shadow-md: 0 10px 26px rgba(26, 19, 56, 0.1), 0 2px 6px rgba(26, 19, 56, 0.06);
  --shadow-violet: 0 16px 34px rgba(108, 43, 255, 0.26);

  --dur: 200ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 620px;
}

/* ---- Reset ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* [hidden] должен побеждать author-display (иначе .btn[hidden] остаётся видимой) */
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 90% at 88% -10%, #efe9ff 0%, rgba(239, 233, 255, 0) 46%),
    radial-gradient(90% 70% at -10% 108%, #fbeedd 0%, rgba(251, 238, 221, 0) 44%),
    var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--purple-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- Layout ----------------------------------------------------------- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  max-width: var(--maxw);
  margin-inline: auto;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-block: 6px 4px;
}

/* ---- Co-brand lockup -------------------------------------------------- */
.cobrand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
}
.cobrand__logo {
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
}
.cobrand__sp {
  width: 84px;
  height: 26px;
  background-image: url('assets/smartpoint-logo.png');
}
.cobrand__yl {
  width: 79px;
  height: 26px;
  background-image: url('assets/yalla-lunch-logo.png');
}
.cobrand__x {
  color: var(--violet-line-strong);
  font-weight: 600;
  font-size: 14px;
}

/* ---- Progress (9 сегментов, коралловый) ------------------------------- */
.progress__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
}
.progress__seg {
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--violet-tint);
  transition: background var(--dur) var(--ease);
}
.progress__seg.is-done {
  background: var(--coral);
}
.progress__seg.is-current {
  background: linear-gradient(90deg, var(--coral) 55%, var(--violet-tint) 55%);
}

/* ---- Stage / screens -------------------------------------------------- */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 22px;
}
.screen {
  display: flex;
  flex-direction: column;
}
@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.screen--anim {
  animation: screenIn var(--dur) var(--ease);
}

/* ---- Typography blocks ------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-eyebrow);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral-ink);
  margin: 0 0 16px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--coral);
}
.title {
  font-size: var(--text-title);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
/* Заголовок получает программный фокус при смене экрана — без видимой рамки */
.title[tabindex]:focus {
  outline: none;
}
.lead {
  font-size: var(--text-lead);
  color: var(--ink-2);
  margin: 18px 0 0;
  max-width: 46ch;
}
.lead--muted {
  color: var(--muted);
}

/* ---- Option cards ----------------------------------------------------- */
.options {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--tap);
  padding: 15px 18px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--violet-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: var(--text-option);
  font-weight: 600;
  transition:
    transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.option__marker {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--violet-line-strong);
  display: grid;
  place-items: center;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.option--multi .option__marker {
  border-radius: 7px;
}
.option__marker svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.option__label {
  flex: 1;
}
@media (hover: hover) {
  .option:hover {
    transform: translateY(-2px);
    border-color: var(--violet-line-strong);
    box-shadow: var(--shadow-md);
  }
}
.option:active {
  transform: translateY(0) scale(0.995);
}
.option.is-selected {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-bright) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-violet);
}
.option.is-selected .option__marker {
  border-color: rgba(255, 255, 255, 0.9);
  background: #fff;
}
.option.is-selected .option__marker svg {
  opacity: 1;
  transform: scale(1);
  color: var(--purple);
}
/* «Другое» вариант — коралловый акцент */
.option--other .option__marker {
  border-style: dashed;
  border-color: var(--coral);
}
.option--other.is-selected {
  background: linear-gradient(135deg, #ef7a1e 0%, var(--coral) 100%);
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.28);
  color: var(--ink); /* тёмный текст на коралловом → контраст ≥5:1 (AA) */
}
.option--other.is-selected .option__marker svg {
  color: var(--coral);
}

/* ---- «Другое» текстовое поле ------------------------------------------ */
.other-field {
  margin-top: 10px;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}
.other-field.is-open {
  grid-template-rows: 1fr;
}
.other-field__inner {
  overflow: hidden;
}
.other-field textarea {
  width: 100%;
  margin-top: 2px;
  padding: 14px 16px;
  min-height: 56px;
  resize: vertical;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--coral);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.other-field textarea::placeholder {
  color: var(--muted);
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 16px 26px;
  border: none;
  border-radius: var(--radius-card);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn--primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-bright) 100%);
  color: #fff;
  box-shadow: var(--shadow-violet);
}
@media (hover: hover) {
  .btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(108, 43, 255, 0.32);
  }
}
.btn--primary:active {
  transform: translateY(0) scale(0.99);
}
.btn--block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-pill);
}
@media (hover: hover) {
  .btn--ghost:hover {
    color: var(--ink);
    background: var(--violet-tint-2);
  }
}
.btn__arrow {
  font-size: 1.1em;
  line-height: 1;
}

/* ---- Footer / nav row ------------------------------------------------- */
.nav {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav--split {
  justify-content: space-between;
}
/* Длинный мультивыбор (Q6): «Далее» прилипает к низу экрана, чтобы не уходить
   под фолд. При коротком контенте ведёт себя как обычный блок в потоке. */
.nav--dock {
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 5;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 44px; /* тап-зона не меньше 44px */
  margin-bottom: 4px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 14px 8px 4px;
  border-radius: var(--radius-pill);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
@media (hover: hover) {
  .back:hover {
    color: var(--purple);
    transform: translateX(-2px);
  }
}

/* ---- Intro / start ---------------------------------------------------- */
.intro .title {
  margin-top: 8px;
}
.intro__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.intro__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

/* ---- Form ------------------------------------------------------------- */
.form {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field__label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.field__req {
  color: var(--coral-ink);
}
.field input[type='text'] {
  width: 100%;
  min-height: var(--tap);
  padding: 15px 18px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--violet-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field input::placeholder {
  color: var(--muted);
  font-weight: 500;
}
.field input[type='text']:focus {
  outline: none;
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

/* Телефон: фиксированный префикс «+7» + национальные цифры в одном поле */
.phone {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--violet-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.phone:focus-within {
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}
.phone.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.12);
}
.phone__cc {
  padding: 15px 4px 15px 18px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}
.phone input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 15px 18px 15px 8px;
  border: none;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  border-radius: var(--radius-card);
}
.phone input:focus {
  outline: none;
  box-shadow: none;
}
.field__error {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
  min-height: 1em;
}

/* Consent checkbox */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
  cursor: pointer;
  user-select: none;
}
.consent input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.consent__box {
  flex: none;
  margin-top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--violet-line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.consent__box svg {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.consent input:checked + .consent__box {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-bright) 100%);
  border-color: transparent;
}
.consent input:checked + .consent__box svg {
  opacity: 1;
  transform: scale(1);
}
.consent input:focus-visible + .consent__box {
  outline: 3px solid var(--purple-bright);
  outline-offset: 3px;
}
.consent__text {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

/* ---- Done screen ------------------------------------------------------ */
.done {
  align-items: center;
  text-align: center;
}
.done__check {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--success-bg);
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  color: var(--success);
}
.done__check svg {
  width: 40px;
  height: 40px;
}
@keyframes checkPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.done__check {
  animation: checkPop 420ms var(--ease) both;
}
.done .title {
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.2rem);
}
.done .lead {
  margin-inline: auto;
  text-align: center;
}
.done .btn {
  margin-top: 28px;
}
.done__copied {
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.done__copied.is-shown {
  opacity: 1;
}

/* ---- Submit / sending state ------------------------------------------- */
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.form__error {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: #fdecec;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.form__error[hidden] {
  display: none;
}

/* ---- Motion / a11y ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Slightly roomier on larger screens */
@media (min-width: 560px) {
  .options {
    gap: 12px;
  }
}
