/* ===================================================================
   PidvezU — спільні стилі авторизації (вхід / реєстрація).
   Використовує CSS-змінні теми з main-page.css.
   =================================================================== */

.auth-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 30px 20px 50px; }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 38px 32px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.auth-card.wide { max-width: 480px; }

.auth-head { text-align: center; margin-bottom: 24px; }
.auth-ic { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 17px; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px var(--glow); }
.auth-head h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.01em; }
.auth-head p { color: var(--text-muted); font-size: 15px; }

.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; }
.auth-field label .opt { color: var(--text-dim); font-weight: 400; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.auth-input { position: relative; }
.auth-input > i.lead { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 15px; pointer-events: none; }
.auth-input input { width: 100%; padding: 14px 44px 14px 42px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 15px; transition: .2s; }
.auth-input input::placeholder { color: var(--text-dim); }
.auth-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }

.toggle-password { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-muted); display: flex; align-items: center; }
.toggle-password .eye-icon { stroke: var(--accent); }

/* Тумблер «Я водій» */
.driver-switch { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: .2s; user-select: none; }
.driver-switch:hover { border-color: var(--border-strong); }
.driver-switch input { position: absolute; opacity: 0; pointer-events: none; }
.driver-switch .ds-icon { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; font-size: 16px; color: var(--accent); background: var(--glow); transition: .2s; }
.driver-switch .ds-text { flex: 1; }
.driver-switch .ds-text strong { display: block; font-size: 14.5px; font-weight: 700; color: var(--text); }
.driver-switch .ds-text span { font-size: 12.5px; color: var(--text-dim); }
.driver-switch .ds-track { width: 46px; height: 26px; flex: none; border-radius: 20px; background: var(--border-strong); position: relative; transition: .25s; }
.driver-switch .ds-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .25s; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.driver-switch input:checked ~ .ds-track { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.driver-switch input:checked ~ .ds-track::after { transform: translateX(20px); }
.driver-switch:has(input:checked) { border-color: var(--accent); background: var(--glow); }
.driver-switch:has(input:checked) .ds-icon { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* Кастомний інпут файлу (фото авто) */
/* .auth-field label задає display:block — підвищуємо специфічність, щоб лишився flex */
.auth-field label.file-drop,
.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 0;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  transition: .2s;
}
.file-drop:hover { border-color: var(--accent); background: var(--glow); }
.file-drop.has-file { border-style: solid; border-color: var(--accent); }
.file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.fd-ic {
  width: 42px; height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 17px;
  color: var(--accent);
  background: var(--glow);
}
.fd-preview { width: 42px; height: 42px; flex: none; border-radius: 11px; object-fit: cover; }

.fd-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fd-text strong { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-text span { font-size: 12px; color: var(--text-dim); }

.fd-clear {
  width: 30px; height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  transition: .2s;
}
.fd-clear:hover { color: #ff8a93; border-color: rgba(230,57,70,.4); }

/* display:grid вище за UA-правило [hidden]{display:none} — повертаємо приховування */
.fd-ic[hidden], .fd-clear[hidden], .fd-preview[hidden] { display: none; }

/* Секція полів авто */
#car_fields { display: grid; gap: 15px; overflow: hidden; }
.car-fields-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.car-fields-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Кнопка */
.auth-submit { position: relative; width: 100%; margin-top: 6px; padding: 15px; border: none; border-radius: 13px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 16px; font-family: inherit; cursor: pointer; transition: .25s; display: flex; align-items: center; justify-content: center; gap: 9px; }
.auth-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 32px var(--glow); }
.auth-submit:disabled, .auth-submit.disabled { opacity: .5; cursor: not-allowed; }
.auth-submit.btn-loading { pointer-events: none; opacity: .8; }
.auth-submit.btn-loading span { visibility: hidden; }
.auth-submit.btn-loading::after { content: ""; position: absolute; width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: authSpin .7s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-links { text-align: right; margin-top: 14px; }
.auth-links a { color: var(--accent); font-size: 14px; font-weight: 600; }

.recaptcha-status { display: none; font-size: 13px; text-align: center; padding: 9px; border-radius: 10px; }
.recaptcha-status.loading { display: block; color: var(--accent); background: var(--surface-2); }
.recaptcha-status.success { display: block; color: var(--success); background: rgba(70,211,154,.12); }
.recaptcha-status.error { display: block; color: #ff8a93; background: rgba(230,57,70,.12); }

.auth-foot { text-align: center; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
.auth-foot a { color: var(--accent); font-weight: 700; }

.alert { padding: 13px 15px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; transition: opacity .3s ease, transform .3s ease; }
.alert-error { background: rgba(230,57,70,.12); border: 1px solid rgba(230,57,70,.4); color: #ff8a93; }
.alert-success { background: rgba(70,211,154,.12); border: 1px solid rgba(70,211,154,.4); color: var(--success); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-dim); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.g_id_signin { display: flex; justify-content: center; }

@media (max-width: 480px) { .auth-row { grid-template-columns: 1fr; } .auth-card { padding: 30px 22px; } }

/* ── Зона натискання текстових посилань ──
   «Забули пароль?», «Зареєструватися», «Увійти» мали висоту рядка 18px:
   на телефоні в таке важко влучити пальцем. Розширюємо саме зону дотику,
   не змінюючи вигляд — вертикальні відступи компенсуємо від'ємним margin. */
@media (pointer: coarse) {
  .auth-links a,
  .auth-switch a,
  .auth-foot a {
    display: inline-block;
    padding: 9px 6px;
    margin: -9px -6px;
  }
}
