/**
 * auth.css — Shared styles for authentication pages.
 *
 * Used by: account/login, account/register, account/me
 *
 * Requires: vars.css, Bootstrap
 */

/* ── Auth page body ────────────────────────────────────────────────────── */
body.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f2c6b 0%, #1a56db 50%, #0ea5e9 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 24px;
}

/* ── Card ──────────────────────────────────────────────────────────────── */
.auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 100%; max-width: 420px;
  overflow: hidden;
}

/* ── Card header ───────────────────────────────────────────────────────── */
.auth-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-lt) 100%);
  padding: 36px 36px 28px;
  color: #fff; text-align: center;
}
.auth-header .icon-wrap {
  width: 64px; height: 64px; border-radius: 18px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; margin-bottom: 14px;
}
.auth-header h5 { font-weight: 700; font-size: 20px; margin: 0 0 4px; letter-spacing: .5px; }
.auth-header p  { opacity: .78; font-size: 13px; margin: 0; }

/* ── Card body ─────────────────────────────────────────────────────────── */
.auth-body { padding: 32px 36px 36px; }

/* ── Form ──────────────────────────────────────────────────────────────── */
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap .bi {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: #9ca3af; font-size: 16px; pointer-events: none;
}
/* eye icons are inline — don't position them absolutely */
i.bi.bi-eye, i.bi.bi-eye-slash { position: static; }
.input-icon-wrap input { padding-left: 38px; }
.input-icon-wrap .toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: #9ca3af; font-size: 16px; background: none; border: none; padding: 0;
}
.input-icon-wrap .toggle-pw:hover { color: var(--blue); }

.form-control {
  border-radius: 10px; border: 1.5px solid #dde4ef;
  font-size: 14px; height: 44px; transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.12); outline: none;
}
.form-control.is-invalid { border-color: var(--red); }
.form-control.is-valid   { border-color: #22c55e; }
.invalid-feedback { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.invalid-feedback.show { display: block; }

/* ── Submit button ─────────────────────────────────────────────────────── */
.btn-primary-grad {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-lt) 100%);
  border: none; color: #fff; font-weight: 600; font-size: 15px;
  height: 46px; border-radius: 10px; width: 100%;
  transition: opacity .18s, transform .12s;
}
.btn-primary-grad:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary-grad:active { transform: translateY(0); }
.btn-primary-grad:disabled { opacity: .55; transform: none; }

/* ── Divider ───────────────────────────────────────────────────────────── */
.divider { text-align: center; position: relative; margin: 22px 0; color: #9ca3af; font-size: 12px; }
.divider::before, .divider::after {
  content: ''; position: absolute; top: 50%; width: calc(50% - 22px);
  height: 1px; background: #e5e7eb;
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ── Alt link (register / login) ───────────────────────────────────────── */
.alt-link { text-align: center; font-size: 13px; color: #6b7280; }
.alt-link a { color: var(--blue); font-weight: 600; text-decoration: none; }
.alt-link a:hover { text-decoration: underline; }

/* ── Inline alert ──────────────────────────────────────────────────────── */
.alert-inline {
  font-size: 13px; border-radius: 10px; padding: 10px 14px;
  display: none; margin-bottom: 18px;
}
.alert-inline.show { display: flex; align-items: center; gap: 8px; }

/* ── Password strength bar (register) ─────────────────────────────────── */
.pw-strength { margin-top: 6px; height: 4px; border-radius: 2px; background: #e5e7eb; overflow: hidden; }
.pw-strength-fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; width: 0; }
.pw-strength-label { font-size: 11px; margin-top: 4px; color: #6b7280; }

/* ── Spinner ───────────────────────────────────────────────────────────── */
.spinner-border-sm { width: 16px; height: 16px; border-width: 2px; }
