/* TWINSET — регистрация клиента. Значения сняты с макета twinset-registration.pen */
:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --sand: #EFEBE4;
  --line: #DAD5CD;
  --line-hover: #C4BDB3;
  --ink: #111111;
  --muted: #6E6860;
  --placeholder: #A39D94;
  --required: #A8322B;
  --alert-bg: #F7EFED;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
  --shadow-pop: 0 12px 32px rgba(17, 17, 17, .10);
  --control-h: 52px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.icon {
  width: 18px; height: 18px; flex: none;
  /* атрибуты спрайта не наследуются в <use> — задаём обводку здесь */
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 16px; height: 16px; }
.icon--muted { color: var(--muted); }

/* ── раскладка ─────────────────────────────────────────────── */
.page { display: grid; grid-template-columns: 600px minmax(0, 1fr); min-height: 100vh; }
.m-header { display: none; }

.visual {
  position: sticky; top: 0;
  height: 100vh; min-height: 640px;
  overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px;
  background: #E8E2DA;
}
.visual picture { position: absolute; inset: 0; z-index: -2; }
.visual__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.visual::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(17,17,17,0) 55%, rgba(17,17,17,.6) 100%);
}
.visual__logo { width: 176px; height: 46px; }
.visual__caption { display: flex; flex-direction: column; gap: 10px; color: #fff; }
.visual__caption p { margin: 0; }
.visual__season { font: italic 400 24px/1.3 var(--serif); }
.visual__claim { font: 400 36px/1.15 var(--sans); letter-spacing: 5px; }
.visual__text { max-width: 380px; font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.9); }

.form-col { padding: 72px 32px 64px; }
.form-wrap { width: 100%; max-width: 600px; margin: 0 auto; }
.view { display: flex; flex-direction: column; gap: 48px; outline: none; }
.form { display: flex; flex-direction: column; gap: 48px; }

/* ── заголовок ─────────────────────────────────────────────── */
.heading { display: flex; flex-direction: column; gap: 12px; }
.heading p, .heading h1 { margin: 0; }
.heading__eyebrow { font: italic 400 22px/1.3 var(--serif); color: var(--muted); }
.heading__title { font: 400 40px/1.15 var(--sans); letter-spacing: 3px; color: var(--ink); }
.heading__lead { font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ── секции ────────────────────────────────────────────────── */
.section { display: flex; flex-direction: column; gap: 24px; }
.section__title {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 0 0 14px; margin: 0;
  border-bottom: 1px solid var(--line);
  font: 500 13px/1.3 var(--sans); letter-spacing: 2.4px; color: var(--ink);
}
.section__num { font: italic 400 20px/1 var(--serif); letter-spacing: 0; color: var(--muted); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ── поле ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 500; letter-spacing: .3px; line-height: 1.3; color: var(--ink); }
.req { margin-left: 3px; color: var(--required); }
.field__hint { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }

.control {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: var(--control-h); padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.control:hover { border-color: var(--line-hover); }
.control:focus-within, .combo.is-open { border-color: var(--ink); box-shadow: inset 0 0 0 .5px var(--ink); }
.control__input {
  flex: 1; min-width: 0; height: 100%;
  padding: 0; border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--ink);
}
.control__input::placeholder { color: var(--placeholder); opacity: 1; }
.icon--lead { color: var(--muted); }
.icon--trail { color: var(--ink); transition: transform .15s ease; }
.combo.is-open .icon--trail { transform: rotate(180deg); }
.control__icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-right: -5px;
  padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
}
.control--textarea { height: 104px; align-items: flex-start; padding: 16px; }
.control--textarea .control__input { height: 100%; resize: none; line-height: 1.45; }
.date-native { position: absolute; right: 16px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* телефон */
.control--phone { padding: 0; gap: 0; }
.phone-country {
  display: flex; align-items: center; gap: 8px; height: 100%;
  padding: 0 12px 0 16px; border-right: 1px solid var(--line);
  font-size: 16px; white-space: nowrap;
}
.control--phone .control__input { padding: 0 16px; }
.flag-ru {
  width: 20px; height: 14px; flex: none;
  border: 1px solid rgba(0,0,0,.08);
  background: linear-gradient(#FFFFFF 0 33.33%, #1C57A5 33.33% 66.66%, #D52B1E 66.66%);
}

/* выбор-«селект» */
.select { cursor: pointer; outline: none; user-select: none; }
.select__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; color: var(--ink); }
.select__value.is-placeholder { color: var(--placeholder); }

/* ошибки */
.field.is-invalid .control { border-color: var(--required); box-shadow: none; }
.field.is-invalid .control:focus-within, .field.is-invalid .combo.is-open { box-shadow: inset 0 0 0 .5px var(--required); }
.field.is-invalid .icon--lead { color: var(--required); }
.field.is-invalid .field__hint { color: var(--required); }

/* недоступно (продавец до выбора магазина) */
.field.is-disabled .field__label { color: var(--placeholder); }
.field.is-disabled .control { background: var(--sand); border-color: var(--sand); cursor: not-allowed; }
.field.is-disabled .select__value, .field.is-disabled .icon { color: var(--placeholder); }

/* ── выпадающие списки ─────────────────────────────────────── */
.dropdown {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: -1px; right: -1px;
  margin: 0; padding: 6px 0; list-style: none;
  max-height: 324px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  cursor: default;
}
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 16px; cursor: pointer;
  font-size: 15px; color: var(--ink);
}
.option[aria-selected="true"], .option.is-active { background: var(--sand); }
.option__main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option__main b { font-weight: 600; }
.option__aside { flex: none; font-size: 12px; color: var(--muted); }
.dropdown__empty { padding: 14px 16px; font-size: 14px; color: var(--muted); }

.dropdown--panel { padding: 0; max-height: none; overflow: visible; }
.dropdown__search { padding: 12px; }
.search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; background: var(--bg); }
.search__input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search__input::placeholder { color: var(--placeholder); opacity: 1; }
.dropdown__group { margin: 0; padding: 8px 16px 6px; font-size: 11px; font-weight: 500; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.dropdown__list { margin: 0; padding: 0 0 6px; list-style: none; max-height: 290px; overflow-y: auto; overscroll-behavior: contain; }
.option--person { justify-content: flex-start; min-height: 56px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 11px; font-weight: 500; letter-spacing: .5px; color: var(--ink);
}
.option--person[aria-selected="true"] .avatar { background: var(--ink); border-color: var(--ink); color: #fff; }
.person { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.person__name { font-size: 15px; }
.person__code { font-size: 12px; color: var(--muted); }
.option__check { visibility: hidden; }
.option--person[aria-selected="true"] .option__check { visibility: visible; }

/* ── капча, согласие, кнопка ───────────────────────────────── */
.captcha { display: flex; gap: 12px; }
.captcha__media { display: flex; gap: 12px; flex: none; }
.captcha__img { width: 168px; height: var(--control-h); background: var(--sand); overflow: hidden; }
.captcha__img img { width: 168px; height: 52px; }
.captcha__refresh {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-h); height: var(--control-h); padding: 0;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); cursor: pointer;
  transition: border-color .15s ease;
}
.captcha__refresh:hover { border-color: var(--line-hover); }
.captcha__refresh.is-spinning .icon { animation: spin .6s linear; }
.captcha__input { flex: 1; min-width: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.consent { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; position: relative; }
.consent__box { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.consent__mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; background: var(--surface); border: 1px solid var(--ink); color: transparent;
}
.consent__box:checked + .consent__mark { background: var(--ink); color: #fff; }
.consent__box:focus-visible + .consent__mark { box-shadow: 0 0 0 3px rgba(17,17,17,.15); }
.field.is-invalid .consent__mark { border-color: var(--required); }
.consent__copy { display: flex; flex-direction: column; gap: 4px; padding-top: 1px; }
.consent__text { font-size: 14px; line-height: 1.5; color: var(--ink); }
.consent__text .req { margin-left: 0; }
.consent__link { font-size: 14px; color: var(--muted); text-decoration: none; align-self: flex-start; }
.consent__link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px; background: var(--alert-bg); border-left: 2px solid var(--required);
  font-size: 14px; line-height: 1.5; color: var(--ink);
}
.alert .icon { color: var(--required); margin-top: 1px; }

.actions { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 56px; padding: 0 32px;
  background: var(--ink); color: #fff; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 500; letter-spacing: 2px;
  transition: background-color .15s ease, opacity .15s ease;
}
.btn:hover { background: #2B2926; }
.btn:focus-visible { outline: 3px solid rgba(17,17,17,.2); outline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.is-loading .icon { animation: nudge .8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }
.actions__note { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; }

/* ── успех ─────────────────────────────────────────────────── */
.card-number {
  display: flex; flex-direction: column; gap: 10px;
  padding: 28px 24px; background: var(--surface); border: 1px solid var(--line);
}
.card-number__label { font-size: 13px; font-weight: 500; letter-spacing: 2px; color: var(--muted); }
.card-number__value { font: 400 40px/1.1 var(--sans); letter-spacing: 6px; color: var(--ink); }

/* ── мобильная раскладка (макет 390) ───────────────────────── */
@media (max-width: 959px) {
  .page { display: block; }
  .m-header {
    display: flex; align-items: center; justify-content: center;
    height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .m-header img { width: 110px; height: 29px; }
  .visual { position: relative; height: 240px; min-height: 0; padding: 24px; justify-content: flex-end; }
  .visual__img { object-position: 50% 22%; }
  .visual__logo, .visual__text { display: none; }
  .visual__caption { gap: 4px; }
  .visual__season { font-size: 18px; }
  .visual__claim { font-size: 22px; letter-spacing: 3px; }
  .form-col { padding: 32px 24px 40px; }
  .view, .form { gap: 40px; }
  .heading__eyebrow { font-size: 18px; }
  .heading__title { font-size: 25px; letter-spacing: 1.5px; }
  .heading__lead { font-size: 14px; }
  .row { grid-template-columns: 1fr; }
  .captcha { flex-direction: column; }
  .captcha__input { flex: none; } /* в колонке flex:1 дал бы базис 0 и сплющил поле */
  .captcha__img { flex: 1; width: auto; }
  .captcha__media { width: 100%; }
  .card-number__value { font-size: 32px; letter-spacing: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
