@font-face {
  font-family: "Huyet Nguyet Serif";
  src: url("../assets/NotoSerifDisplay-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #100405;
  --panel: #190708;
  --panel-soft: #240a0c;
  --line: #4e2422;
  --line-gold: #7c5427;
  --blood: #7e1418;
  --blood-bright: #b8292e;
  --gold: #c6923a;
  --gold-light: #f0d58e;
  --text: #f3e8d2;
  --muted: #ad9d8d;
  --danger: #f07a7a;
  --success: #9fd18d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--ink);
  font-family: "Huyet Nguyet Serif", Georgia, serif;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
a, button { -webkit-tap-highlight-color: transparent; }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(420px, 46vw) minmax(0, 1fr);
  min-height: 100svh;
}

.auth-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  overflow: hidden;
  border-right: 1px solid rgba(198, 146, 58, 0.28);
}

.auth-visual__background,
.auth-visual__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.auth-visual__background { object-fit: cover; object-position: 38% center; }
.auth-visual__shade {
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 2, 3, 0.18), rgba(10, 2, 3, 0.62));
}

.auth-brand { display: block; width: min(68%, 440px); }
.auth-brand img {
  display: block;
  width: 100%;
  max-height: 58svh;
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.62));
}

.auth-visual__caption {
  position: absolute;
  bottom: 38px;
  margin: 0;
  color: rgba(240, 213, 142, 0.75);
  font-size: 11px;
  font-weight: 800;
}

.auth-main {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 74px clamp(34px, 7vw, 116px);
  background:
    linear-gradient(135deg, rgba(126, 20, 24, 0.1), transparent 42%),
    #120506;
}

.auth-main--register { align-content: start; }

.auth-nav {
  position: absolute;
  top: 34px;
  right: clamp(34px, 7vw, 116px);
  display: flex;
  gap: 24px;
}

.auth-nav a {
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.auth-nav a:hover,
.auth-nav a:focus-visible,
.auth-nav a.is-active {
  outline: none;
  border-color: var(--gold);
  color: var(--gold-light);
}

.auth-panel { width: min(100%, 590px); margin: 0 auto; }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: 11px; font-weight: 900; }
.auth-panel h1,
.dashboard-heading h1 {
  margin: 0;
  color: var(--gold-light);
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.08;
}

.auth-intro { max-width: 520px; margin: 14px 0 28px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.account-form { display: grid; gap: 17px; }
.account-form--register { gap: 15px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: #dcccb0; font-size: 13px; font-weight: 800; }
.field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  color: var(--text);
  background: #0b0304;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.field input::placeholder { color: #70615b; }
.field input:focus { border-color: var(--gold); background: #100405; box-shadow: 0 0 0 3px rgba(198, 146, 58, 0.1); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field__help { min-height: 15px; color: #7f7068; font-family: Arial, sans-serif; font-size: 11px; }
.field__error { min-height: 16px; color: var(--danger); font-family: Arial, sans-serif; font-size: 12px; }
.field__help + .field__error:empty { display: none; }

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border: 1px solid #b47c2d;
  border-radius: 3px;
  color: #fff0bd;
  background: #721317;
  box-shadow: inset 0 0 0 1px rgba(240, 213, 142, 0.1), 0 14px 32px rgba(0, 0, 0, 0.24);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(240, 213, 142, 0.16);
  pointer-events: none;
}

.primary-button:hover,
.primary-button:focus-visible { outline: none; border-color: var(--gold-light); background: #8d181d; transform: translateY(-1px); }
.primary-button:disabled { opacity: 0.58; cursor: wait; transform: none; }
.primary-button--compact { width: fit-content; min-width: 220px; }

.form-message { min-height: 20px; margin: -2px 0 0; color: var(--muted); font-family: Arial, sans-serif; font-size: 13px; line-height: 1.5; }
.form-message[data-state="error"] { color: var(--danger); }
.form-message[data-state="success"] { color: var(--success); }
.auth-switch { margin: 25px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.auth-switch a, .home-link { color: var(--gold-light); font-weight: 800; text-decoration: none; }
.home-link { display: block; margin-top: 17px; font-size: 11px; text-align: center; }
.auth-switch a:hover, .home-link:hover { color: #fff5d5; }
.notice { padding: 12px 14px; border-left: 3px solid var(--gold); color: var(--muted); background: rgba(198, 146, 58, 0.08); font-family: Arial, sans-serif; font-size: 13px; }
.notice--success { border-color: var(--success); color: var(--success); }

.dashboard-page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  background: #0d0304;
}

.dashboard-page::before,
.dashboard-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.dashboard-page::before {
  z-index: -2;
  background: url("../assets/huyet-nguyet-hero.png") center center / cover no-repeat;
  filter: saturate(1.02) contrast(1.08) brightness(0.82);
  transform: scale(1.01);
}

.dashboard-page::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 2, 3, 0.72) 0%, rgba(8, 2, 3, 0.34) 34%, rgba(8, 2, 3, 0.2) 66%, rgba(8, 2, 3, 0.5) 100%),
    linear-gradient(180deg, rgba(8, 2, 3, 0.24), rgba(8, 2, 3, 0.6));
}

.dashboard-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 clamp(22px, 5vw, 72px);
  border-top: 2px solid rgba(198, 146, 58, 0.48);
  border-bottom: 1px solid rgba(198, 146, 58, 0.34);
  background: rgba(11, 3, 4, 0.8);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.dashboard-brand { display: flex; align-items: center; gap: 12px; color: var(--gold-light); font-size: 12px; font-weight: 900; text-decoration: none; }
.dashboard-brand img { width: 46px; height: 46px; object-fit: contain; }
.dashboard-header__account {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 17px 6px 7px;
  border: 1px solid #b47c2d;
  border-radius: 3px;
  color: #fff0bd;
  background: linear-gradient(180deg, #8f1a1f, #5d0d11);
  box-shadow: inset 0 0 0 2px rgba(240, 213, 142, 0.1), 0 8px 22px rgba(0, 0, 0, 0.34);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.dashboard-header__account::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 231, 170, 0.14);
  pointer-events: none;
}

.dashboard-header__account-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(240, 213, 142, 0.55);
  border-radius: 50%;
  color: #ffe6a5;
  background: #310709;
  font-size: 12px;
}

.dashboard-header__account-mark svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-header__account:hover,
.dashboard-header__account:focus-visible {
  outline: none;
  border-color: #f0d58e;
  background: linear-gradient(180deg, #ad242a, #721217);
  box-shadow: inset 0 0 0 2px rgba(240, 213, 142, 0.16), 0 10px 26px rgba(88, 8, 11, 0.46);
  transform: translateY(-1px);
}
.dashboard-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  width: min(calc(100% - 64px), 1420px);
  min-height: calc(100svh - 108px);
  margin: 32px auto 0;
  overflow: hidden;
  border: 1px solid rgba(198, 146, 58, 0.3);
  background: rgba(13, 3, 4, 0.62);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), inset 0 1px rgba(240, 213, 142, 0.06);
  backdrop-filter: blur(9px);
}
.account-sidebar {
  min-height: calc(100svh - 108px);
  padding: 38px 28px;
  border-right: 1px solid rgba(198, 146, 58, 0.24);
  background: linear-gradient(180deg, rgba(45, 9, 11, 0.72), rgba(13, 3, 4, 0.72));
}
.account-identity { display: flex; align-items: center; gap: 13px; padding-bottom: 30px; border-bottom: 1px solid #34201d; }
.account-avatar { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line-gold); border-radius: 50%; color: var(--gold-light); background: #581014; font-size: 18px; font-weight: 900; }
.account-identity small { display: block; margin-bottom: 3px; color: #7e7064; font-size: 9px; font-weight: 900; }
.account-identity strong { display: block; overflow: hidden; max-width: 135px; color: var(--text); font-size: 16px; text-overflow: ellipsis; }
.account-nav { display: grid; gap: 5px; margin-top: 26px; }
.account-nav a { padding: 11px 12px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 800; text-decoration: none; }
.account-nav a:hover, .account-nav a:focus-visible, .account-nav a.is-active { outline: none; border-color: var(--gold); color: var(--gold-light); background: rgba(198, 146, 58, 0.06); }
.logout-form { margin-top: 36px; }
.logout-form button { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; color: #baaaa0; background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.logout-form button:hover, .logout-form button:focus-visible { outline: none; border-color: #8f3c3b; color: #ffd3ce; }

.dashboard-content {
  min-width: 0;
  padding: 54px clamp(26px, 6vw, 76px) 80px;
  background:
    linear-gradient(135deg, rgba(126, 20, 24, 0.14), transparent 42%),
    rgba(12, 3, 4, 0.58);
}
.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 34px; }
.dashboard-heading h1 { font-size: clamp(30px, 4vw, 42px); }
.status-badge { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #4b743f; border-radius: 3px; color: var(--success); background: rgba(91, 133, 70, 0.08); font-family: Arial, sans-serif; font-size: 9px; font-weight: 800; }
.dashboard-section { padding: 32px 0; border-top: 1px solid #3a211f; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 28px; margin-bottom: 25px; }
.section-heading h2 { margin: 0; color: var(--gold-light); font-size: 22px; }
.section-heading p { margin: 0; color: #82746c; font-family: Arial, sans-serif; font-size: 12px; }
.account-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid #33201e; border-left: 1px solid #33201e; }
.account-details div { min-width: 0; padding: 19px 20px; border-right: 1px solid #33201e; border-bottom: 1px solid #33201e; background: rgba(25, 7, 8, 0.36); }
.account-details dt { margin-bottom: 6px; color: #807169; font-family: Arial, sans-serif; font-size: 11px; }
.account-details dd { margin: 0; overflow-wrap: anywhere; color: #eadcc5; font-size: 14px; font-weight: 700; }
.text-success { color: var(--success) !important; }
.text-warning { color: #d5a24d !important; }
.security-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #3a211f;
  border-bottom: 1px solid #3a211f;
  background: rgba(8, 2, 3, 0.24);
}

.security-option {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 190px;
  padding: 28px 22px;
  border: 0;
  border-right: 1px solid #3a211f;
  color: #8f8177;
  background: transparent;
  text-align: center;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.security-option:last-child { border-right: 0; }
.security-option:hover,
.security-option:focus-visible,
.security-option.is-active { outline: none; color: var(--gold-light); background: rgba(126, 20, 24, 0.1); }
.security-option__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 4px;
  border: 1px dashed #9a6b2d;
  border-radius: 50%;
  color: var(--gold);
}

.security-option.is-active .security-option__icon { border-style: solid; box-shadow: inset 0 0 22px rgba(198, 146, 58, 0.08); }
.security-option__icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.security-option strong { color: inherit; font-size: 15px; }
.security-option small { color: #74675f; font-family: Arial, sans-serif; font-size: 10px; }
.security-option.is-active small { color: #a79787; }
.security-panel { padding-top: 32px; }
.security-panel__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.security-panel__heading h3 { margin: 0; color: var(--gold-light); font-size: 20px; }
.security-panel__heading p { margin: 0; color: #82746c; font-family: Arial, sans-serif; font-size: 12px; }
.password-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.password-form .form-message, .password-form .primary-button { grid-column: 1 / -1; }

@media (max-width: 920px) {
  .auth-layout { grid-template-columns: minmax(300px, 38vw) minmax(0, 1fr); }
  .auth-brand { width: 82%; }
  .auth-main { padding-inline: 36px; }
  .auth-nav { right: 36px; }
  .password-form { grid-template-columns: 1fr; }
  .password-form .form-message, .password-form .primary-button { grid-column: auto; }
}

@media (max-width: 720px) {
  .auth-layout { display: block; }
  .auth-visual { min-height: 230px; border-right: 0; border-bottom: 1px solid rgba(198, 146, 58, 0.28); }
  .auth-visual__background { object-position: 54% 44%; }
  .auth-brand { width: 190px; }
  .auth-brand img { max-height: 190px; }
  .auth-visual__caption { bottom: 14px; }
  .auth-main, .auth-main--register { min-height: calc(100svh - 230px); padding: 78px 20px 44px; }
  .auth-nav { position: absolute; top: 252px; right: 20px; }
  .field-row { grid-template-columns: 1fr; gap: 15px; }
  .dashboard-header { padding-inline: 18px; }
  .dashboard-header__account { min-height: 38px; padding: 5px 11px 5px 5px; font-size: 9px; }
  .dashboard-header__account-mark { width: 26px; height: 26px; }
  .dashboard-page::before { background-position: 66% center; }
  .dashboard-page::after { background: rgba(8, 2, 3, 0.62); }
  .dashboard-layout { display: block; width: 100%; min-height: calc(100svh - 76px); margin: 0; border: 0; }
  .account-sidebar { min-height: auto; padding: 20px 18px; border-right: 0; border-bottom: 1px solid #34201d; }
  .account-identity { padding-bottom: 18px; }
  .account-nav { display: flex; margin-top: 15px; overflow-x: auto; }
  .account-nav a { white-space: nowrap; }
  .logout-form { margin-top: 14px; }
  .dashboard-content { padding: 34px 18px 60px; }
  .dashboard-heading, .section-heading { display: block; }
  .status-badge { display: inline-flex; margin-top: 16px; }
  .section-heading p { margin-top: 8px; line-height: 1.5; }
  .account-details { grid-template-columns: 1fr; }
  .security-options { grid-template-columns: 1fr; }
  .security-option { min-height: 150px; border-right: 0; border-bottom: 1px solid #3a211f; }
  .security-option:last-child { border-bottom: 0; }
  .security-panel__heading { display: block; }
  .security-panel__heading p { margin-top: 8px; line-height: 1.5; }
  .primary-button--compact { width: 100%; min-width: 0; }
}

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