/* Đăng nhập / Đăng ký — bố cục dùng chung (22/11/2026).
 * Kế thừa token sáng/tối của portal-min.css (--bg, --card, --ink, --gold…),
 * nên nút đổi giao diện ở header vẫn áp dụng. Một việc mỗi trang: điền form.
 */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  caret-color: var(--gold);
  accent-color: var(--gold);
}
.auth-page ::selection { background: var(--gold); color: var(--gold-ink); }

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  width: min(1240px, 100%);
  min-height: calc(100vh - 40px);
  margin: 0 auto;
  padding: 112px clamp(16px, 4vw, 48px) 56px;
}

/* ---- tranh bên trái (chỉ desktop) ---- */
.auth__art {
  position: relative;
  align-self: stretch;
  min-height: 520px;
  max-height: 720px;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #0b0d12;
}
.auth__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.auth__art figcaption {
  position: absolute; inset: auto 0 0;
  display: flex; align-items: center; gap: 14px;
  padding: 72px 28px 26px;
  background: linear-gradient(transparent, rgb(6 8 12 / .88));
  color: #eef0f4; font-size: 16px; font-weight: 500;
}
.auth__art figcaption img { width: 52px; height: 52px; flex: none; object-fit: contain; }
.auth__art figcaption b { display: block; font-size: 19px; font-weight: 700; }
.auth__art figcaption span { color: #c9ceda; font-size: 15px; }

/* ---- form ---- */
.auth-card {
  width: 100%;
  padding: 36px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.auth-card h1 {
  margin: 0 0 24px;
  font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em;
  color: var(--ink);
}
.auth-form { display: grid; gap: 18px; }

.auth-page .field { display: grid; gap: 7px; margin: 0; }
.auth-page #g_id_signin { margin: 0; }
.field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.auth-page .field label { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: 0; }
.field__top a { font-size: 14px; font-weight: 500; color: var(--gold); text-decoration: none; }
.field__top a:hover { color: var(--gold-strong); text-decoration: underline; text-underline-offset: .2em; }
.field__box { position: relative; }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--input-border); border-radius: 10px;
  background: var(--input-bg); color: var(--ink);
  font: 500 16px var(--sans);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:hover { border-color: color-mix(in srgb, var(--input-focus) 45%, var(--input-border)); }
.field input:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--gold-soft); }
.field__box--eye input { padding-right: 52px; }
.field__eye {
  position: absolute; top: 2px; right: 2px; bottom: 2px; width: 46px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 20px; cursor: pointer;
}
.field__eye:hover { color: var(--ink); }
.field__hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.field.is-bad input { border-color: var(--red); }
.field.is-bad .field__hint { color: var(--red); }
.field.is-good .field__hint { color: var(--green); }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.meter i { height: 4px; border-radius: 2px; background: var(--line); transition: background-color .2s; }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--red); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--amber-ink); }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--gold); }
.meter[data-level="4"] i { background: var(--green); }

/* Turnstile chạy ẩn; khung chỉ mở khi Cloudflare cần người dùng tương tác
 * (data-before-interactive-callback thêm .is-interactive). */
.auth-status { display: grid; gap: 12px; }
.auth-status:not(:has(.formmsg.err, .formmsg.ok, .ts-wrap.is-interactive)) { height: 0; margin: -9px 0; overflow: hidden; }
.auth-page .ts-wrap { margin: 0; height: 0; overflow: hidden; }
.auth-page .ts-wrap.is-interactive { height: auto; overflow: visible; }
.auth-page .formmsg { margin: 0; text-align: left; font-size: 14px; }

.auth-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 50px;
  border: 0; border-radius: 10px;
  background: var(--gold); color: var(--gold-ink);
  font: 700 16px var(--sans); cursor: pointer;
  transition: background-color .15s, transform .15s cubic-bezier(.16, 1, .3, 1);
}
.auth-submit:hover:not(:disabled) { background: var(--gold-strong); }
.auth-submit:active:not(:disabled) { transform: scale(.98); }
.auth-submit:disabled { cursor: progress; opacity: .75; }
.auth-submit .ti { font-size: 18px; }

.auth-or {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  margin: 4px 0 0; color: var(--muted); font-size: 13px;
}
.auth-or::before, .auth-or::after { content: ""; height: 1px; background: var(--line); }
.auth-page .btn-google { min-height: 48px; font-size: 15px; border-radius: 10px; }

.auth-switch-line { margin: 22px 0 0; text-align: center; color: var(--body-c); font-size: 15px; }
.auth-switch-line a { color: var(--gold); font-weight: 600; text-decoration: none; }
.auth-switch-line a:hover { color: var(--gold-strong); text-decoration: underline; text-underline-offset: .2em; }

.auth-page :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.auth-page .field input:focus-visible { outline: none; }

/* Cổng đăng ký đóng: thông báo gọn trong thẻ, ẩn form. */
.auth-page .reg-disabled-notice { margin: 0 0 4px; padding: 18px; text-align: left; border-radius: 12px; }
.auth-page .reg-disabled-title { font-size: 15px; letter-spacing: 0; margin-bottom: 6px; }
.auth-page .reg-disabled-desc { font-size: 14px; }
.auth-page .reg-disabled-notice .auth-submit { margin-top: 14px; text-decoration: none; }
html.reg-closed .auth-page #reg-form-wrap { display: none; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; min-height: 0; padding-top: 96px; justify-items: center; }
  .auth__art { display: none; }
  .auth-card { max-width: 460px; }
}
@media (max-width: 520px) {
  .auth { padding: 84px 16px 40px; }
  .auth-card { padding: 26px 20px 24px; border-radius: 14px; }
  .auth-card h1 { font-size: 26px; margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { transition-duration: .01ms !important; }
}

/* Giao diện sáng: vàng nhạt trên trắng không đủ 4.5:1, dùng tông đậm. */
[data-theme="light"] .auth-submit { background: var(--gold-strong); color: #fff; }
[data-theme="light"] .auth-submit:hover:not(:disabled) { background: #7a5718; }
[data-theme="light"] .field__top a, [data-theme="light"] .auth-switch-line a { color: var(--gold-strong); }
/* Footer chung: chữ bản quyền chỉ đạt ~3:1; nâng lên ≥5:1 trong phạm vi trang auth. */
html[data-theme="dark"] .auth-page .site-footer { --sfx-faint: #858c78; }
html[data-theme="light"] .auth-page .site-footer { --sfx-faint: #6f6550; }
.auth-page .sf-note, .auth-page .field__hint { text-wrap: pretty; }
html.reg-closed .auth-page .auth-switch-line { display: none; }
