/* ==========================================================================
   Account-form — shared primitives for SMS-verification (/phone/, verify)
   and driver-profile setup (/driver/) pages. Same dark-card aesthetic as
   /login/ but with its own input primitives, hence the dedicated BEM
   block `.account-form__*`.
   ========================================================================== */

.account-form {
  /* Вычитаем in-flow шапку: с голыми 100vh каждая страница флоу была
     «шапка + целый экран» — под карточкой сотни px пустоты и футер за
     фолдом даже когда контент влезал. */
  min-height: calc(100vh - var(--header-height));
  padding: 40px var(--container-padding-x) 64px;
  display: grid;
  /* Одна строка + центр: раньше было auto 1fr — вторая 1fr-строка
     осталась от логотипа, который шаблоны давно не рендерят, и карточка
     прижималась к верху над ~500px мёртвой зоны. Если карточка выше
     вьюпорта, min-height просто перестаёт связывать — страница скроллится
     как обычно. */
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 194, 5, 0.08) 0%, transparent 60%),
    var(--color-bg);
}

.account-form__card {
  width: 100%;
  max-width: 520px;
  padding: 44px clamp(24px, 4vw, 48px);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.96) 0%, rgba(12, 12, 12, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(245, 194, 5, 0.06);
  text-align: center;
}

.account-form__card--wide {
  max-width: 680px;
}

.account-form__eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 194, 5, 0.14);
  border: 1px solid rgba(245, 194, 5, 0.45);
  color: var(--color-accent-from);
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.account-form__title {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: var(--shadow-text);
  color: var(--color-text);
}

.account-form__lede {
  margin: 18px auto 0;
  max-width: 380px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.account-form__lede strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Form ------------------------------------------------------------------- */
.account-form__form {
  margin-top: 32px;
  display: grid;
  gap: 8px;
  text-align: left;
}

.account-form__form--grid {
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 22px;
}

.account-form__field {
  display: grid;
  gap: 9px;
}

.account-form__field--full {
  grid-column: 1 / -1;
}

.account-form__label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.account-form__label-aside {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.4);
}

.account-form__input {
  width: 100%;
  height: 60px;
  padding: 0 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  text-overflow: ellipsis;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.account-form__input:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.account-form__input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.account-form__input:focus {
  outline: none;
  border-color: rgba(245, 194, 5, 0.55);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(245, 194, 5, 0.15);
}

/* Native <select> styled to match the text inputs: custom arrow, dark
   field. Make / model / colour on /driver/ use this. */
.account-form__select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 48px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M6 9l6 6 6-6' stroke='%23f5c205' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px 20px;
}

/* The native option list is OS-painted; force a dark palette where the
   browser honours it (Chromium/Firefox) so it matches the card. */
.account-form__select option {
  background: #141414;
  color: var(--color-text);
}

/* Type-ahead inputs (make / model) carry a <datalist>. Give them the SAME
   gold chevron as the <select> so every "pick from suggestions" field reads
   as one consistent set, and suppress the browser's own (grey, inconsistent)
   datalist button so we don't get two mismatched arrows. */
.account-form__input[list] {
  padding-right: 48px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M6 9l6 6 6-6' stroke='%23f5c205' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px 20px;
}

.account-form__input[list]::-webkit-calendar-picker-indicator,
.account-form__input[list]::-webkit-list-button {
  display: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.account-form__input--code {
  font-family: var(--font-display);
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 28px;
  padding-left: 0;
  padding-right: 0;
}

.account-form__input--code::placeholder {
  letter-spacing: 0.4em;
}

.account-form__input--textarea {
  height: auto;
  min-height: 96px;
  padding: 14px 18px;
  line-height: 1.5;
  font-size: 16px;
  resize: vertical;
}

.account-form__input--error,
.account-form__input--error:focus {
  border-color: rgba(255, 107, 107, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

.account-form__hint {
  margin: 4px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
}

.account-form__error {
  margin: 4px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: #ff8a8a;
}

/* Consent checkbox (Phase 6.5) ------------------------------------------- */
.account-form__consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  column-gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.account-form__consent:hover {
  border-color: rgba(245, 194, 5, 0.3);
  background: rgba(245, 194, 5, 0.04);
}

.account-form__consent:has(.account-form__consent-input:checked) {
  border-color: rgba(245, 194, 5, 0.45);
  background: rgba(245, 194, 5, 0.06);
}

.account-form__consent-input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .15s ease, background .15s ease;
  flex-shrink: 0;
}

.account-form__consent-input:hover {
  border-color: rgba(245, 194, 5, 0.55);
}

.account-form__consent-input:checked {
  background: var(--grad-accent);
  border-color: rgba(245, 194, 5, 0.7);
}

.account-form__consent-input:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M5 12l4 4 10-10' stroke='%23060606' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
}

.account-form__consent-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 194, 5, 0.25);
}

.account-form__consent-text {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
}

.account-form__consent-text a {
  color: var(--color-accent-from);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(245, 194, 5, 0.4);
}

.account-form__consent-text a:hover {
  text-decoration-color: var(--color-accent-from);
}

/* Submit button ---------------------------------------------------------- */
.account-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px auto 0;
  padding: 0 32px;
  height: 60px;
  min-width: 260px;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-button);
  background: var(--grad-accent);
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(16px, 1.6vw, 19px);
  text-transform: uppercase;
  box-shadow: var(--shadow-button), 0 8px 24px rgba(245, 194, 5, 0.18);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.account-form__btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: var(--shadow-button), 0 12px 32px rgba(245, 194, 5, 0.32);
}

.account-form__btn:active {
  transform: translateY(0);
}

.account-form__btn:disabled,
.account-form__btn.is-cooldown {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.55;
  transform: none;
  box-shadow: var(--shadow-button);
}

/* RU branch: numbers we can't SMS (+7 9XX) log in via Telegram. The JS
   swaps the SMS submit for this block by toggling [hidden] on the
   country wrappers. The wrappers stay transparent to the form's grid
   (display: contents) so the buttons keep centering as direct grid items
   exactly as before the wrappers were introduced. */
[data-country-sms],
[data-country-ru] {
  display: contents;
}

/* display: contents would otherwise swallow the [hidden] attribute — make
   hidden win so the gated block actually collapses. */
[data-country-sms][hidden],
[data-country-ru][hidden] {
  display: none;
}

.account-form__ru-branch .account-form__hint {
  text-align: center;
}

.account-form__btn--tg {
  text-decoration: none;
  background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff;
  box-shadow: var(--shadow-button), 0 8px 24px rgba(34, 158, 217, 0.3);
}

.account-form__btn--full {
  grid-column: 1 / -1;
  margin-top: 12px;
}

/* Notice (expired / locked) ---------------------------------------------- */
.account-form__notice {
  margin: 32px auto 0;
  padding: 18px 22px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

.account-form__notice--error {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ff8a8a;
}

/* Resend link ------------------------------------------------------------ */
.account-form__resend {
  display: inline-block;
  margin-left: 6px;
  color: var(--color-accent-from);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.account-form__resend--inline {
  display: block;
  margin: 20px auto 0;
  font-family: var(--font-body);
  font-size: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.account-form__resend:hover {
  filter: brightness(1.1);
}

/* During the resend cooldown the link shows a live countdown and is
   non-interactive (see sms-cooldown.js). */
.account-form__resend.is-cooldown {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

/* Resend is a real POST (re-sends to the same number) — strip the native
   button chrome so it still reads like the inline text link. */
.account-form__resend-form {
  margin: 20px auto 0;
  text-align: center;
}

button.account-form__resend {
  display: inline-block;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
}

button.account-form__resend:disabled {
  cursor: default;
}

/* Hint block (collapsible) ----------------------------------------------- */
.account-form__hint-block {
  margin: 28px auto 0;
  max-width: 420px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.account-form__hint-block summary {
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  transition: color .15s ease;
}

.account-form__hint-block summary:hover { color: var(--color-accent-from); }
.account-form__hint-block summary::-webkit-details-marker { display: none; }
.account-form__hint-block summary::before {
  content: "▾  ";
  font-size: 12px;
  display: inline-block;
  transition: transform .15s ease;
}

.account-form__hint-block[open] summary::before { transform: rotate(180deg); }

.account-form__hint-block p {
  margin: 12px 0 0;
  line-height: 1.55;
}

@media (max-width: 480px) {
  .account-form { padding-top: 24px; gap: 28px; }
  .account-form__card { padding: 30px 20px; }
  .account-form__title { font-size: clamp(24px, 7vw, 32px); }
  .account-form__lede { font-size: 15px; }
  .account-form__form { margin-top: 26px; }
  /* Однострочные лейблы на телефонах: прячем декоративную иконку, ужимаем
     паддинги и кегль — «Войти через Telegram» (20 симв.) влезает в 320px.
     height: auto + min-height вместо фикс-высоты: сверхдлинные лейблы
     (/billing/, /local/publish/) переносятся и растят кнопку, а не
     режутся; однострочные остаются ровно 56px. height: auto обязателен —
     база задаёт height: 60px. */
  .account-form__btn {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 56px;
    padding: 0 12px;
    font-size: 15px;
  }
  .account-form__btn > svg { display: none; }
  /* Single column on phones — clearest for first-time drivers, and the
     type-ahead fields get full width so nothing clips. */
  .account-form__form--grid { grid-template-columns: 1fr; row-gap: 18px; }
}
