/* Doctorly — вход и регистрация (/auth). Поверх site.css: те же цвета, шрифт и кнопки.
   Страница открывается в приложении (ASWebAuthenticationSession), поэтому сначала — телефон. */

.auth-page main { padding: 104px 0 40px; min-height: 100vh; min-height: 100dvh; }
.auth-page .nav__inner { height: 64px; }

.auth { display: grid; place-items: start center; }
.auth__card {
  position: relative; width: min(460px, 100%); padding: 40px 36px 32px;
  border-radius: 32px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); overflow: hidden; isolation: isolate;
}
.auth__card::before {
  content: ""; position: absolute; z-index: -1; inset: -45% -40% auto auto; width: 380px; height: 380px;
  border-radius: 50%; background: radial-gradient(circle, rgba(104,195,120,.2), transparent 65%); pointer-events: none;
}
/* Знак из пакета — квадрат с полями: поля компенсируются, чтобы знак стоял по левому краю текста. */
.auth__mark { width: 64px; height: 64px; margin: -8px 0 10px -14px; }
.auth__card h1 { font-size: 30px; letter-spacing: -.035em; margin-bottom: 8px; }
.auth__lead { color: var(--muted); font-size: 16px; line-height: 1.5; margin-bottom: 24px; }

/* Переключатель «Вход · Регистрация» — как сегменты в приложении. */
.seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 24px;
  border-radius: 16px; background: var(--app-bg);
}
.seg__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 13px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(20,33,28,.08), 0 4px 12px -4px rgba(20,33,28,.12);
  transition: transform .35s var(--ease);
}
.seg[data-active="register"] .seg__thumb { transform: translateX(100%); }
.seg button {
  position: relative; height: 40px; border: 0; background: none; cursor: pointer;
  font: 600 15px/1 var(--font); color: var(--muted); transition: color .25s;
}
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { color: var(--ink); }
.seg[data-active="doctor"] .seg__thumb { transform: translateX(100%); }
.seg--role { margin-bottom: 4px; }

/* Заявка врача на регистрации (2.7). */
.doctor { display: grid; gap: 14px; margin: 6px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.doctor[hidden] { display: none; }
.doctor__title { padding: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.doctor__lead { color: var(--muted); font-size: 14px; line-height: 1.5; }
.field select, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(20,33,28,.14); background: #fff;
  color: var(--ink); font: 400 17px/1.3 var(--font); transition: border-color .2s, box-shadow .2s;
}
.field select { height: 52px; padding: 0 16px; }
.field textarea { resize: vertical; min-height: 88px; }
.field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(104,195,120,.18); }
.field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(231,77,63,.12); }
.field [hidden] { display: none; }
.field[hidden] { display: none; }
.field__label { font-size: 14px; font-weight: 500; color: var(--text); }
.upload { position: relative; display: inline-flex; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload__button {
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 12px;
  background: var(--app-bg); color: var(--ink); font: 600 15px/1 var(--font);
}
.upload input:focus-visible + .upload__button { box-shadow: 0 0 0 4px rgba(104,195,120,.3); }
.upload.is-invalid .upload__button { box-shadow: 0 0 0 2px var(--red); }
.upload__list { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; font-size: 14px; color: var(--text); }
.upload__list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--app-bg); }
.upload__list button { border: 0; background: none; color: var(--muted); cursor: pointer; font: 500 14px/1 var(--font); }
.upload__list button:hover { color: var(--red); }
.retry { display: grid; gap: 4px; }
.retry[hidden] { display: none; }

.form { display: grid; gap: 14px; }
.form[hidden] { display: none; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; color: var(--text); }
.field input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px;
  border: 1px solid rgba(20,33,28,.14); background: #fff; color: var(--ink);
  font: 400 17px/1 var(--font); transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: var(--soft); }
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(104,195,120,.18); }
.field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(231,77,63,.12); }
.field__hint { font-size: 13px; color: var(--soft); }
.field__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.password { position: relative; }
.password input { padding-right: 52px; }
.password button {
  position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.password button:hover { color: var(--ink); background: var(--app-bg); }
.password svg { width: 22px; height: 22px; }

/* [hidden] иначе перебивает display: grid — «Чужой компьютер» был виден и при входе приложения и админки. */
.check[hidden] { display: none; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.check input {
  width: 24px; height: 24px; margin: 0; border-radius: 8px; border: 1.5px solid rgba(20,33,28,.24);
  background: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s, border-color .2s;
  -webkit-appearance: none; appearance: none;
}
.check input::after {
  content: ""; width: 12px; height: 7px; border: solid #fff; border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .2s var(--ease);
}
.check input:checked { background: var(--green-800); border-color: var(--green-800); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check.is-invalid input { border-color: var(--red); box-shadow: 0 0 0 4px rgba(231,77,63,.12); }
.check a { color: var(--green-700); }

.btn--block {
  width: 100%; min-height: 54px; height: auto; padding-top: 12px; padding-bottom: 12px; font-size: 16px; line-height: 1.25;
  border: 0; cursor: pointer; font-family: var(--font); white-space: normal; text-align: center;
}
.btn--block:disabled { cursor: progress; opacity: .7; transform: none; }
.btn__spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; display: none; }
.is-busy .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.alert[hidden] { display: none; }
.alert--error { background: rgba(231,77,63,.08); color: #B3271B; }
.alert--ok { background: var(--mint-50); color: var(--green-800); }

.link-btn { justify-self: center; border: 0; background: none; padding: 6px 8px; font: 500 15px/1.2 var(--font); color: var(--green-700); cursor: pointer; border-radius: 8px; }
.link-btn:hover { color: var(--green-800); }

.auth__legal { margin-top: 22px; font-size: 13px; color: var(--soft); text-align: center; line-height: 1.5; }
.auth__legal a { color: var(--muted); }

/* Готово: вход выполнен, возвращаемся в приложение. */
.done { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 8px 0 4px; }
.done[hidden] { display: none; }
.done__icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-50); color: var(--green-800); }
.done__icon svg { width: 36px; height: 36px; }
.done h2 { font-size: 24px; letter-spacing: -.03em; }
.done p { color: var(--muted); font-size: 16px; }
.done .btn { margin-top: 8px; }

/* Восстановление пароля — системный dialog. */
.sheet { width: min(420px, calc(100% - 32px)); border: 0; border-radius: 28px; padding: 28px 24px 24px; box-shadow: var(--shadow-lg); color: var(--text); }
.sheet::backdrop { background: rgba(11,23,19,.4); backdrop-filter: blur(2px); }
.sheet h2 { font-size: 22px; letter-spacing: -.03em; margin-bottom: 8px; }
.sheet p { color: var(--muted); font-size: 15px; margin-bottom: 18px; line-height: 1.5; }
.sheet .form { gap: 12px; }
.sheet__actions { display: grid; gap: 4px; }

@media (max-width: 560px) {
  .auth-page main { padding: 84px 0 24px; }
  .auth-page .container { width: calc(100% - 32px); }
  .auth__card { padding: 30px 20px 24px; border-radius: 28px; }
  .auth__card h1 { font-size: 27px; }
  .field__row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .seg__thumb, .check input::after { transition: none; }
}
