/* ═══════════════════════════════════════════════════════════════
   VIT LOGISTICS · auth.css — окно входа (js/auth-modal.js)
   Матовая угольная карточка с золотой кромкой, по центру экрана;
   на телефоне — нижняя шторка. Анимации — только opacity/transform.
   Токены и кнопки/поля — из core.css.
   ═══════════════════════════════════════════════════════════════ */

.auth { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 24px 16px; }
.auth[hidden] { display: none; }
.auth__scrim {
  position: absolute; inset: 0;
  background: rgba(8, 8, 9, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s var(--ease);
}
.auth.is-on .auth__scrim { opacity: 1; }

.auth__dialog {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain;
  padding: 34px clamp(22px, 4vw, 36px) 28px;
  border: 1px solid transparent; border-radius: 22px;
  background:
    radial-gradient(70% 40% at 50% 0%, rgba(232, 201, 106, .07), transparent 70%) padding-box,
    linear-gradient(180deg, var(--ink-3), var(--ink-2)) padding-box,
    var(--edge-gold) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 40px 80px -30px #000;
  opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.auth.is-on .auth__dialog { opacity: 1; transform: none; }
.auth__dialog:focus { outline: none; }
.auth__grip { display: none; }

.auth__close {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(12, 12, 13, .5); color: var(--text-2);
  transition: color .2s, border-color .2s;
}
.auth__close:hover { color: var(--gold-l); border-color: var(--line-gold); }
.auth__close .ico { width: 16px; height: 16px; }

.auth__head { display: grid; justify-items: center; text-align: center; margin-bottom: 22px; }
.auth__logo { width: auto; height: 46px; margin-bottom: 16px; }
.auth__title { font: 500 var(--fs-h3)/1.2 var(--f-head); letter-spacing: -.01em; }
.auth__lead { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-2); max-width: 32ch; }

/* Вкладки: общий «жёлоб», золотая черта едет под активной */
.auth__tabs {
  position: relative; display: flex; gap: 2px; padding: 4px; margin-bottom: 20px;
  border-radius: 12px; background: var(--ink); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--line);
}
.auth__tab {
  position: relative; z-index: 1; flex: 1; min-height: 38px; padding: 0 8px; border: 0; border-radius: 9px; background: none;
  font: 600 var(--fs-xs)/1.2 var(--f-body); color: var(--text-3); transition: color .2s;
}
.auth__tab[hidden] { display: none; }
.auth__tab:hover { color: var(--text); }
.auth__tab.is-active { color: var(--gold-l); }
.auth__ink {
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 9px; pointer-events: none;
  background: var(--ink-4); box-shadow: inset 0 0 0 1px rgba(201, 168, 76, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .35s var(--ease), width .35s var(--ease);
}
.auth__regoff { margin: -8px 0 16px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--warn); background: rgba(224, 163, 71, .08); box-shadow: inset 0 0 0 1px rgba(224, 163, 71, .25); }

.auth__pane { display: grid; gap: 14px; }
.auth__pane[hidden] { display: none; }
.auth__pane.is-in { animation: auth-in .35s var(--ease); }
@keyframes auth-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.auth__field .field__input { min-height: 46px; }
.auth__field .field__input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 123, 107, .14); }
.auth__pw { position: relative; }
.auth__pw .field__input { padding-right: 46px; }
.auth__eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--text-3);
}
.auth__eye:hover { color: var(--gold-l); }
.auth__eye .ico { width: 18px; height: 18px; }

.auth__link { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; font-size: var(--fs-xs); font-weight: 600; color: var(--gold-l); }
.auth__link:hover { color: var(--text); }
.auth__forgot { justify-self: end; margin-top: -6px; }
.auth__back .ico { width: 16px; height: 16px; }
.auth__sub { font: 600 var(--fs-h4)/1.3 var(--f-head); }
.auth__hint { font-size: var(--fs-xs); line-height: 1.55; color: var(--text-2); }
.auth__note { font-size: 12px; color: var(--text-3); text-align: center; }
.auth__note a:hover { color: var(--gold-l); }

/* Надёжность пароля: три сегмента */
.auth__meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: -6px; }
.auth__meter span { height: 3px; border-radius: 2px; background: var(--ink-4); transition: background-color .25s; }
.auth__meter em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--text-3); }
.auth__meter[data-strength="1"] span:nth-child(1) { background: var(--danger); }
.auth__meter[data-strength="2"] span:nth-child(-n+2) { background: var(--warn); }
.auth__meter[data-strength="3"] span { background: var(--ok); }

/* Кнопка отправки: спиннер во время запроса */
.auth__submit { margin-top: 4px; min-height: 50px; }
.auth__spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(23, 19, 10, .3); border-top-color: #17130a; animation: auth-spin .7s linear infinite; }
.auth__submit.is-loading .auth__spin { display: block; }
.auth__submit:disabled { cursor: progress; filter: saturate(.8); }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth__or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-3); }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__google { width: 100%; min-height: 48px; border-color: var(--line); background: var(--ink); color: var(--text); }
.auth__google:hover { border-color: rgba(255, 255, 255, .25); background: var(--ink-3); }
.auth__google:disabled { opacity: .6; }
.auth__g { width: 18px; height: 18px; }

.auth__msg { min-height: 0; margin-top: 0; font-size: 13px; line-height: 1.5; color: var(--danger); text-align: center; opacity: 0; transition: opacity .2s; }
.auth__msg.is-on { min-height: 1.5em; margin-top: 16px; opacity: 1; }
.auth__msg[data-kind="ok"] { color: var(--ok); }
.auth__msg a { color: var(--gold-l); text-decoration: underline; text-underline-offset: 3px; }

html[lang="ka"] .auth__title { letter-spacing: 0; }

/* Телефон: нижняя шторка */
@media (max-width: 640px) {
  .auth { place-items: end stretch; padding: 0; }
  .auth__dialog {
    width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: opacity .2s, transform .38s var(--ease);
  }
  .auth.is-on .auth__dialog { transform: none; }
  .auth__grip { display: block; width: 40px; height: 4px; margin: -12px auto 14px; border-radius: 2px; background: var(--ink-5); }
  .auth__close { top: 12px; right: 12px; }
  .auth__logo { height: 38px; margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth__dialog, .auth__scrim, .auth__ink { transition: none; }
  .auth__pane.is-in { animation: none; }
}
