/* ============================================================
   Nexpeco — liquid glass.
   Спільна основа для екранів-майстрів: реєстрація, онбординг.
   Одна картка, один набір кнопок, одна поведінка скла.
   ============================================================ */

.glass-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;

  display: grid;
  place-items: center;
  padding: 1.25rem;

  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* М'які кольорові плями під склом — без них розмиття нема чого розмивати. */
.glass-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38rem 38rem at 15% 12%, rgba(24, 217, 163, 0.16), transparent 62%),
    radial-gradient(32rem 32rem at 85% 85%, rgba(24, 217, 163, 0.09), transparent 60%),
    radial-gradient(28rem 28rem at 70% 10%, rgba(120, 140, 255, 0.07), transparent 60%);
}

/* --- Шапка кроку (поза карткою) ------------------------------ */

.step-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.step-head h1 {
  flex: 1;
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.01em;
}

/* Кругла кнопка «назад» — скляна, як у макеті. */
.icon-btn {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;

  font-size: 0.95rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Скляна картка ------------------------------------------- */

.glass-card {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;

  background:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.09) 0%,
      rgba(255, 255, 255, 0.03) 45%,
      rgba(255, 255, 255, 0.05) 100%
    ),
    rgba(18, 19, 21, 0.62);

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-xl);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);

  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.glass-card-left { text-align: left; }

.card-title {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.card-sub {
  margin: 0 0 1.75rem;
  color: var(--text-soft);
  font-size: 1rem;
}


/* --- Поля форм (спільні для реєстрації й редактора профілю) --- */

.field {
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding: 0;
  border: none;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
  padding: 0;
}

.field-wrap {
  position: relative;
  display: block;
}

.field-input {
  width: 100%;
  min-width: 0;
  padding: 0.82rem 1rem;

  font: inherit;
  color: var(--text);

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  transition: var(--transition);
  resize: vertical;
}

.field-wrap .field-input { padding-right: 3rem; }

.field-input::placeholder { color: var(--text-muted); }

/*
  iOS малює datetime-local власним контролом: він ширший за сусідні поля,
  значення стоїть по центру, і вся ця зайва ширина робила поп-ап
  прокручуваним убік — палець ледь зсувався, і картка від'їжджала.
  Скидаємо нативний вигляд і вирівнюємо значення, як у решті полів.
*/
input[type="datetime-local"].field-input,
input[type="date"].field-input,
input[type="time"].field-input {
  -webkit-appearance: none;
  appearance: none;
  min-height: 3.1rem;    /* без нативного вигляду поле худне — тримаємо висоту */
  text-align: left;
}

.field-input::-webkit-date-and-time-value {
  margin: 0;             /* саме цей відступ і зсував значення в центр */
  text-align: left;
}

/* Іконка календаря малюється чорним — у темній темі її не видно. */
.field-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.55;
  cursor: pointer;
}

/* Автозаповнення браузера фарбує поле в світло-блакитний і ламає темну тему.
   Фон тут перебити можна лише внутрішньою тінню. */
.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 100px #1b1c1e inset;
  box-shadow: 0 0 0 100px #1b1c1e inset;
  transition: background-color 9999s ease-out 0s;
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-hint {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  justify-self: end;
}

/* --- Кнопки -------------------------------------------------- */

.btn-primary {
  width: 100%;
  padding: 0.95rem 1.5rem;
  margin-top: 1.5rem;

  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent-ink);

  background: var(--accent);
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: 0 10px 28px var(--accent-glow);
  transition: var(--transition);
}

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

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary:focus-visible,
.btn-text:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-text {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.5rem;

  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);

  background: none;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-text:hover { color: var(--accent-hover); }

/* --- Запасний варіант без backdrop-filter -------------------- */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card { background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover:not(:disabled) { transform: none; }
}

/* --- Прапорець із підписом (фільтри, форми) ------------------- */

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
}

.check-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-mark {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  display: grid;
  place-items: center;

  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 0.35rem;
  transition: var(--transition);
}

.check-mark::before {
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.15rem;
  background: var(--accent);
  transform: scale(0);
  transition: transform var(--t-fast) var(--ease-out);
}

.check-row input:checked + .check-mark::before { transform: scale(1); }

.check-row input:focus-visible + .check-mark {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check-text {
  display: grid;
  gap: 0.1rem;
  font-size: 0.95rem;
}

.check-text small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Список вибору в рядку налаштувань / фільтра -------------- */

.setting-select {
  height: var(--control-h);
  padding: 0 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text-soft);

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--transition);
}

.setting-select:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }

.setting-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Список, що випадає, малює система — темний фон задаємо явно. */
.setting-select option {
  color: var(--text);
  background: var(--surface-2);
}
