:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #0a1017;
  --panel: #101a25;
  --surface: #162230;
  --stroke: #2b3d4f;
  --stroke-strong: #3e566b;
  --text: #edf5fb;
  --muted: #adbdca;
  --soft: #8195a8;
  --accent: #79deb0;
  --accent-ink: #082218;
  --danger: #f2b5bb;
  --danger-bg: #392329;
  --shadow: 0 28px 90px rgb(0 0 0 / 34%);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-width: 320px; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button, a { color: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.auth-shell { display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 1.1fr) minmax(440px, .9fr); }
.auth-intro {
  position: relative;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
  border-right: 1px solid var(--stroke);
  background:
    radial-gradient(circle at 68% 38%, rgb(65 184 133 / 14%), transparent 30%),
    linear-gradient(145deg, #0d1721 0%, #091017 70%);
}
.auth-intro::after {
  position: absolute;
  right: -140px;
  bottom: -180px;
  width: 440px;
  height: 440px;
  border: 1px solid rgb(121 222 176 / 13%);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgb(121 222 176 / 3%), 0 0 0 160px rgb(121 222 176 / 2%);
  content: "";
}
.auth-brand { position: relative; z-index: 1; display: flex; width: fit-content; align-items: center; gap: 12px; }
.auth-brand-mark, .mobile-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #2b654d;
  border-radius: 15px;
  background: #113326;
  color: var(--accent);
  font-size: 31px;
  font-weight: 800;
}
.auth-brand strong { display: block; font-size: 16px; letter-spacing: -.4px; }
.auth-brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.3px; }
.intro-copy { position: relative; z-index: 1; max-width: 680px; padding: 70px 0; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 1.8px; }
.intro-copy h1 { max-width: 640px; margin: 0; font-size: clamp(42px, 5vw, 72px); font-weight: 740; letter-spacing: -3px; line-height: 1.08; }
.intro-copy h1 em { color: var(--accent); font-style: normal; }
.intro-copy > p:not(.eyebrow) { max-width: 610px; margin: 25px 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.feature-list { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.feature-list li { display: flex; align-items: flex-start; gap: 10px; }
.feature-list span { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; background: rgb(121 222 176 / 12%); color: var(--accent); font-size: 12px; }
.back-link { position: relative; z-index: 1; width: fit-content; color: var(--accent); font-size: 14px; font-weight: 700; }
.back-link:hover { text-decoration: underline; }

.auth-panel { display: grid; min-height: 100dvh; place-items: center; padding: 32px; background: #0c131c; }
.auth-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--stroke); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.register-card { width: min(580px, 100%); padding: 24px 28px; }
.register-card .auth-card-header { margin-bottom: 16px; }
.register-card .auth-card-header h2 { font-size: 30px; }
.register-card form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.register-card .field { min-width: 0; align-self: start; gap: 5px; }
.register-card .field input { min-height: 44px; }
.register-card .consent,
.register-card form > .field-error,
.register-card .primary-button { grid-column: 1 / -1; }
.register-card .primary-button { min-height: 44px; }
.register-card .auth-switch { margin-top: 14px; }
.register-card .auth-disclaimer { margin-top: 12px; padding-top: 12px; line-height: 1.45; }
.auth-card-header { margin-bottom: 26px; }
.mobile-mark { display: none; margin-bottom: 20px; }
.auth-card-header h2 { margin: 0; font-size: 34px; letter-spacing: -1.2px; line-height: 1.2; }
.auth-card-header > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 700; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  outline: 0;
  background: #0c151f;
  color: var(--text);
  font-size: 16px;
  transition: border-color .18s, box-shadow .18s;
}
.field input::placeholder { color: #6f8496; }
.field input:hover { border-color: var(--stroke-strong); }
.field input:focus { border-color: #579178; box-shadow: 0 0 0 3px rgb(121 222 176 / 9%); }
.field input[aria-invalid="true"] { border-color: #a75a62; }
.field-error { min-height: 0; color: var(--danger); font-size: 12px; }
.field-error:empty { display: none; }
.field-hint { color: var(--soft); font-size: 12px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check-row input { width: 17px; height: 17px; flex: 0 0 17px; margin: 2px 0 0; accent-color: var(--accent); }
.consent { line-height: 1.55; }
.primary-button { min-height: 48px; padding: 10px 18px; border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.primary-button:hover { background: #9cecc8; }
.auth-switch { margin: 24px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.auth-switch a { color: var(--accent); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }
.auth-disclaimer { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--stroke); color: var(--soft); font-size: 12px; line-height: 1.6; text-align: center; }
.auth-notice { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #7a444d; border-radius: 11px; background: var(--danger-bg); color: var(--danger); font-size: 13px; line-height: 1.6; }
.auth-notice[data-state="success"] { border-color: #37775d; background: #122f25; color: #a5eccb; }
.auth-notice[data-state="info"] { border-color: var(--stroke-strong); background: #132230; color: var(--muted); }
.password-meter { height: 5px; overflow: hidden; border-radius: 999px; background: var(--stroke); }
.password-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: #db7b68; transition: width .2s, background .2s; }

@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
  .auth-panel { padding: 22px; background: radial-gradient(circle at 50% 0, rgb(65 184 133 / 11%), transparent 34%), var(--bg); }
  .mobile-mark { display: grid; }
}

@media (max-width: 520px) {
  .auth-panel { align-items: start; padding: 14px; }
  .auth-card { margin: 10px 0; padding: 24px 20px; border-radius: 18px; }
  .auth-card-header { margin-bottom: 22px; }
  .auth-card-header h2 { font-size: 30px; }
  .form-options { align-items: flex-start; flex-direction: column; }

  .register-card { width: 100%; margin: 0; padding: 18px 14px; }
  .register-card .auth-card-header { margin-bottom: 12px; }
  .register-card .auth-card-header h2 { font-size: 27px; }
  .register-card form { gap: 9px 8px; }
  .register-card .field input { min-height: 42px; padding-inline: 9px; font-size: 14px; }
  .register-card .field:nth-child(3) .password-toggle { font-size: 0; }
  .register-card .field:nth-child(3) .password-toggle::after { content: "Hiện"; font-size: 12px; }
  .register-card .field:nth-child(3) .password-toggle[aria-pressed="true"]::after { content: "Ẩn"; }
  .register-card .consent { font-size: 12px; line-height: 1.4; }
  .register-card .auth-switch { margin-top: 10px; }
  .register-card .auth-disclaimer { margin-top: 8px; padding-top: 8px; }

  .reset-page .auth-panel { padding: 8px; }
  .reset-page .auth-card { width: 100%; margin: 0; padding: 18px 14px; }
  .reset-page .auth-card-header { margin-bottom: 12px; }
  .reset-page .auth-card-header h2 { font-size: 27px; }
  .reset-page form { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 8px; }
  .reset-page .field { min-width: 0; }
  .reset-page .field input { min-height: 42px; padding-inline: 9px; }
  .reset-page .primary-button { grid-column: 1 / -1; }
  .reset-page .auth-disclaimer { margin-top: 8px; padding-top: 8px; }
}

@media (max-width: 920px) and (max-height: 680px) {
  .register-page .auth-panel { padding-block: 8px; }
  .register-card .mobile-mark,
  .register-card .auth-card-header > p:last-child,
  .register-card .field-hint { display: none; }
  .reset-page .mobile-mark,
  .reset-page .auth-card-header > p:last-child { display: none; }
  .reset-page .auth-notice { margin-bottom: 8px; padding-block: 8px; }
  .reset-page form { row-gap: 6px; }
  .register-card .eyebrow { margin-bottom: 6px; }
  .register-card form { row-gap: 6px; }
  .register-card .auth-switch { margin-top: 6px; }
  .register-card .auth-disclaimer { margin-top: 4px; padding-top: 4px; }
}

@media (max-height: 760px) and (min-width: 921px) {
  .intro-copy { padding: 28px 0; }
  .intro-copy h1 { font-size: 48px; }
  .feature-list { gap: 8px; margin-top: 18px; }
  .auth-card { padding-block: 24px; }
}

@media (max-height: 820px) and (min-width: 921px) {
  .login-page .auth-intro,
  .register-page .auth-intro { padding: 40px; }
  .login-page .intro-copy,
  .register-page .intro-copy { padding: 28px 0; }
  .login-page .intro-copy h1,
  .register-page .intro-copy h1 { font-size: 48px; }
  .login-page .feature-list,
  .register-page .feature-list { gap: 8px; margin-top: 18px; }
  .register-page .register-card { padding-block: 24px; }
}

@media (max-height: 680px) and (min-width: 921px) {
  .register-page .auth-panel { padding: 12px; }
  .register-page .register-card { padding: 18px 22px; }
  .register-card .auth-card-header > p:last-child,
  .register-card .field-hint { display: none; }
  .register-card form { row-gap: 8px; }
  .register-card .auth-switch { margin-top: 8px; }
  .register-card .auth-disclaimer { margin-top: 8px; padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
