:root {
  --auth-ink: #1a1a1a;
  --auth-paper: #f8f9fa;
  --auth-gold: #ffd700;
  --auth-gold-deep: #edc600;
  --auth-bronze: #cd7f32;
  --auth-bronze-ink: #765015;
  --auth-line: rgba(229, 229, 229, .14);
  --auth-ease: cubic-bezier(.22, 1, .36, 1);
}

html { box-sizing: border-box; overflow-x: clip; }
*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; font-family: 'Inter', sans-serif; overflow-x: clip; }
button, a { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ===== Nav auth widgets (dùng chung mọi trang — không đổi) ===== */
.auth-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 215, 0, .42);
  border-radius: 12px;
  color: #ffd700;
  background: rgba(255, 215, 0, .08);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .22s var(--auth-ease), background .22s var(--auth-ease), border-color .22s var(--auth-ease);
}
.auth-entry:hover { transform: translateY(-1px); background: rgba(255, 215, 0, .16); border-color: #ffd700; }
body.login-page .audit-site-nav a.auth-entry { text-decoration: none !important; }
.auth-entry[hidden], .auth-account[hidden] { display: none; }
.auth-entry__icon { width: 16px; height: 16px; }
.auth-account { position: relative; display: inline-flex; align-items: center; }
.auth-account__trigger { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 5px 11px 5px 6px; border: 1px solid rgba(248,249,250,.26); border-radius: 12px; color: #f8f9fa; background: rgba(248,249,250,.05); font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.auth-account__trigger:hover, .auth-account__trigger[aria-expanded='true'] { border-color: rgba(255,215,0,.65); background: rgba(255,215,0,.09); }
.auth-account__trigger svg { width: 14px; height: 14px; transition: transform .2s var(--auth-ease); }
.auth-account__trigger[aria-expanded='true'] svg { transform: rotate(180deg); }
.auth-account__avatar { display: inline-grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,215,0,.58); color: #ffd700; background: #302a1a; font-size: 12px; font-weight: 800; }
.auth-account__menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 70; width: min(300px, calc(100vw - 32px)); padding: 16px; border: 1px solid rgba(255,215,0,.24); border-radius: 14px; color: #f8f9fa; background: #242424; box-shadow: 0 18px 50px rgba(0,0,0,.32); }
.auth-account__menu[hidden] { display: none; }
.auth-account__full-name, .auth-account__email { display: block; margin: 0; overflow-wrap: anywhere; line-height: 1.5; }
.auth-account__full-name { font-size: 14px; font-weight: 800; }
.auth-account__email { margin-top: 2px; color: #d7d7d7; font-size: 12px; }
.auth-account__menu .auth-account__email { padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.14); }
.auth-account__link, .auth-account__logout { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; color: inherit; background: transparent; text-align: left; font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer; }
.auth-account__link:hover, .auth-account__logout:hover { color: #ffd700; background: rgba(255,215,0,.09); }
.auth-account__logout { margin-top: 6px; border-top: 1px solid rgba(255,255,255,.14); border-radius: 0; }
.auth-account--drawer { align-items: flex-start; flex-wrap: wrap; gap: 8px; width: 100%; padding: 14px 0 6px; border-top: 1px solid rgba(255,255,255,.13); color: #f8f9fa; }
.auth-account--drawer .auth-account__details { flex: 1 1 150px; min-width: 0; }
.auth-account--drawer .auth-account__actions { display: flex; flex-direction: column; gap: 2px; flex: 1 0 100%; }
body#top #site-nav > nav { overflow: visible; }
.auth-status { position: absolute; top: 100%; right: clamp(12px, 3vw, 32px); z-index: 80; width: min(360px, calc(100% - 24px)); margin: 8px 0 0; padding: 11px 14px; border: 1px solid #d9a98a; border-radius: 10px; color: #5c2114; background: #fff5ed; box-shadow: 0 8px 24px rgba(0,0,0,.14); font-size: 13px; line-height: 1.5; }
.auth-status[hidden] { display: none; }
.auth-entry:focus-visible, .auth-account button:focus-visible, .auth-account a:focus-visible, .login-card a:focus-visible, .login-retry:focus-visible, .login-secondary:focus-visible { outline: 3px solid #ffd700; outline-offset: 3px; }

.audit-auth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid rgba(205, 127, 50, .28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 215, 0, .1), rgba(255, 255, 255, .04));
}
.audit-auth p { margin: 0; color: inherit; font-size: 14px; line-height: 1.5; }
.audit-auth-action { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border: 1px solid #ffd700; border-radius: 10px; color: #1a1a1a; background: #ffd700; font-size: 13px; font-weight: 800; white-space: nowrap; }
.audit-auth-action:hover { background: #edc600; }
.audit-auth-action[hidden] { display: none; }
.nav-auth-drawer { display: none; }

/* ===== Trang đăng nhập — nền charcoal + hào quang gold nhẹ ===== */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  color: #f8f9fa;
  background-color: #0d0d0d;
  background-image:
    radial-gradient(920px 620px at 82% -12%, rgba(255, 215, 0, .09), transparent 62%),
    radial-gradient(720px 520px at -8% 112%, rgba(205, 127, 50, .08), transparent 60%);
  background-attachment: fixed;
}
.login-page .audit-nav-inner { max-width: 1440px; }
.login-page .audit-nav-links { gap: 12px; }
.login-page .audit-nav-actions { gap: 8px; }
.login-page .audit-nav-contact { padding-inline: 16px; }
.login-skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 16px; color: #1a1a1a; background: #ffd700; transform: translateY(-150%); }
.login-skip-link:focus { transform: translateY(0); }

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 520px);
  align-items: center;
  justify-content: center;
  gap: clamp(48px, 7vw, 104px);
  width: min(100%, 1240px);
  min-height: calc(100vh - 74px);
  min-height: calc(100dvh - 74px);
  margin: auto;
  padding: 48px 32px 40px;
}

/* --- Cột trái: brand story 3T --- */
.login-hero { position: relative; max-width: 560px; padding: 24px 0 8px 28px; border-left: 1px solid rgba(255, 215, 0, .55); }
.login-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  border: 1px solid rgba(255, 215, 0, .3);
  border-radius: 999px;
  color: var(--auth-gold);
  background: rgba(255, 215, 0, .08);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.login-hero__eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--auth-gold); box-shadow: 0 0 10px rgba(255, 215, 0, .8); }
.login-hero h1 { margin: 22px 0 16px; font-size: clamp(40px, 4.2vw, 60px); font-weight: 800; line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
.login-hero h1 span { color: var(--auth-gold); }
.login-hero__lead { max-width: 470px; margin: 0 0 28px; color: #d8d8d8; font-size: 16px; line-height: 1.65; text-wrap: pretty; }
.login-hero__props { display: grid; gap: 14px; max-width: 470px; margin: 0; padding: 0; list-style: none; }
.login-hero__props li { display: flex; align-items: flex-start; gap: 12px; color: #cfcfcf; font-size: 14px; line-height: 1.6; }
.login-hero__props strong { color: var(--auth-gold); font-weight: 800; }
.login-hero__prop-icon { display: inline-grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; margin-top: 1px; border: 1px solid rgba(255, 215, 0, .38); border-radius: 50%; color: var(--auth-gold); background: rgba(255, 215, 0, .07); }
.login-hero__prop-icon svg { width: 15px; height: 15px; }

/* --- Cột phải: card đăng nhập glass --- */
.login-card-shell { position: relative; width: 100%; }
.login-status-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 24px; margin-bottom: 12px; }
.login-status { margin: 0; color: #ffe16a; font-size: 14px; line-height: 1.5; }
.login-status:empty { display: none; }
.login-status a { color: var(--auth-gold); }
.login-retry { min-height: 44px; padding: 0 12px; border: 1px solid rgba(255, 225, 106, .55); border-radius: 8px; color: #ffe16a; background: transparent; font-size: 14px; font-weight: 700; cursor: pointer; }
.login-retry[hidden] { display: none; }
.login-retry:hover { background: rgba(255, 215, 0, .12); }

.login-card {
  width: 100%;
  padding: clamp(28px, 4vw, 40px);
  border: 1px solid var(--auth-line);
  border-top: 2px solid var(--auth-gold);
  border-radius: 20px;
  color: #f8f9fa;
  background: rgba(248, 249, 250, .04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.login-card[hidden] { display: none; }
.login-card__eyebrow { margin: 0 0 18px; color: var(--auth-bronze); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.login-card h2 { margin: 0 0 10px; font-size: 29px; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.login-card__desc { margin: 0 0 24px; color: #c9c9c9; font-size: 15px; line-height: 1.6; }
.login-error { margin: 0 0 18px; padding: 12px 14px; border: 1px solid rgba(255, 138, 138, .35); border-radius: 10px; color: #ffb4b4; background: rgba(139, 30, 30, .18); font-size: 13px; line-height: 1.55; }
.login-error[hidden] { display: none; }
.login-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(26, 26, 26, .12);
  border-radius: 12px;
  color: var(--auth-ink);
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s var(--auth-ease), box-shadow .2s var(--auth-ease);
}
.login-google:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0, 0, 0, .35); }
.login-google svg { width: 18px; height: 18px; }
.login-google--primary { border-color: rgba(255, 215, 0, .8); color: #1a1a1a; background: var(--auth-gold); }
.login-google--primary:hover { background: var(--auth-gold-deep); box-shadow: 0 12px 28px rgba(255, 215, 0, .18); }
.login-card__hint { margin: 12px 0 0; color: #a8a8a8; font-size: 13px; text-align: center; }
.login-card__trust { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 0; padding: 10px 12px; border: 1px solid rgba(255, 215, 0, .2); border-radius: 10px; color: #e9e9e9; background: rgba(255, 215, 0, .05); font-size: 12.5px; line-height: 1.5; text-align: left; }
.login-card__trust svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--auth-gold); }
.login-card__legal { margin: 18px 0 0; color: #9a9a9a; font-size: 12.5px; line-height: 1.6; }
.login-card__legal a { color: var(--auth-gold); text-decoration: none; }
.login-card__identity { margin: 0 0 22px; padding: 12px 14px; border: 1px solid rgba(255, 215, 0, .24); border-radius: 10px; background: rgba(255, 215, 0, .06); overflow-wrap: anywhere; }
.login-card__identity strong { color: var(--auth-gold); font-size: 15px; }
.login-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.login-card__actions a { display: inline-flex; align-items: center; min-height: 44px; color: #cfcfcf; font-size: 13px; font-weight: 700; text-decoration: none; }
.login-card__actions a:hover { color: var(--auth-gold); }
.login-secondary { min-height: 44px; padding: 0; border: 0; color: #cfcfcf; background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.login-secondary:hover { color: var(--auth-gold); text-decoration: none; }

/* --- Footer mini --- */
.login-footer { display: flex; flex-direction: column; align-items: center; gap: 4px; width: min(100%, 1240px); margin: 0 auto; padding: 0 32px 28px; color: #8f8f8f; text-align: center; }
.login-footer__brand { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.login-footer__brand span { color: var(--auth-bronze); }
.login-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.login-footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: #b5b5b5; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.login-footer__links a:hover { color: var(--auth-gold); }
.login-footer__copy { margin: 0; font-size: 11.5px; }

/* ===== Chế độ sáng (data-ui-theme do js/auth-ui.js đặt) ===== */
body.login-page[data-ui-theme='light'] {
  color: #1a1a1a;
  background-color: #eef0f2;
  background-image:
    radial-gradient(920px 620px at 82% -12%, rgba(255, 215, 0, .14), transparent 62%),
    radial-gradient(720px 520px at -8% 112%, rgba(205, 127, 50, .1), transparent 60%);
}
body.login-page[data-ui-theme='light'] .login-hero { border-left-color: rgba(118, 80, 21, .55); }
body.login-page[data-ui-theme='light'] .login-hero__eyebrow { color: var(--auth-bronze-ink); border-color: rgba(118, 80, 21, .3); background: rgba(118, 80, 21, .07); }
body.login-page[data-ui-theme='light'] .login-hero__eyebrow-dot { background: var(--auth-bronze-ink); box-shadow: none; }
body.login-page[data-ui-theme='light'] .login-hero h1 span { color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-hero__lead { color: #404040; }
body.login-page[data-ui-theme='light'] .login-hero__props li { color: #4a4a4a; }
body.login-page[data-ui-theme='light'] .login-hero__props strong { color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-hero__prop-icon { color: var(--auth-bronze-ink); border-color: rgba(118, 80, 21, .38); background: rgba(118, 80, 21, .07); }
body.login-page[data-ui-theme='light'] .login-card { color: #1a1a1a; background: var(--auth-paper); border-color: rgba(26, 26, 26, .12); box-shadow: 0 24px 60px rgba(26, 26, 26, .12); }
body.login-page[data-ui-theme='light'] .login-card__desc { color: #505050; }
body.login-page[data-ui-theme='light'] .login-error { color: #8b1e1e; border-color: rgba(139, 30, 30, .25); background: #fff0f0; }
body.login-page[data-ui-theme='light'] .login-card__hint { color: #575757; }
body.login-page[data-ui-theme='light'] .login-card__trust { color: #3d3d3d; border-color: rgba(118, 80, 21, .24); background: rgba(118, 80, 21, .06); }
body.login-page[data-ui-theme='light'] .login-card__trust svg { color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-card__legal { color: #575757; }
body.login-page[data-ui-theme='light'] .login-card__legal a { color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-card__identity { border-color: #e4ded0; background: #f4f1e9; }
body.login-page[data-ui-theme='light'] .login-card__identity strong { color: #1a1a1a; }
body.login-page[data-ui-theme='light'] .login-card__actions a { color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-card__actions a:hover { color: #4d350d; }
body.login-page[data-ui-theme='light'] .login-secondary { color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-secondary:hover { color: #4d350d; }
body.login-page[data-ui-theme='light'] .login-status, body.login-page[data-ui-theme='light'] .login-retry { color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-retry { border-color: rgba(118, 80, 21, .45); }
body.login-page[data-ui-theme='light'] .login-retry:hover { background: rgba(140, 92, 14, .1); }
body.login-page[data-ui-theme='light'] .login-card a:focus-visible, body.login-page[data-ui-theme='light'] .login-retry:focus-visible, body.login-page[data-ui-theme='light'] .login-secondary:focus-visible { outline-color: var(--auth-bronze-ink); }
body.login-page[data-ui-theme='light'] .login-footer { color: #6b6b6b; }
body.login-page[data-ui-theme='light'] .login-footer__links a { color: #4a4a4a; }
body.login-page[data-ui-theme='light'] .login-footer__links a:hover { color: var(--auth-bronze-ink); }
body[data-ui-theme='light'] .auth-entry { color: #1a1a1a; border-color: #ffd700; background: #ffd700; }
body[data-ui-theme='light'] .auth-entry:hover { background: #f0cb62; border-color: #f0cb62; color: #1a1a1a; }
body[data-ui-theme='light'] .auth-account__trigger { color: #1a1a1a; border-color: rgba(26,26,26,.2); background: rgba(26,26,26,.04); }
body[data-ui-theme='light'] .auth-account--drawer { color: #1a1a1a; border-top-color: rgba(26,26,26,.13); }
body[data-ui-theme='light'] .auth-account--drawer .auth-account__email { color: #555; }
body[data-ui-theme='light'] .audit-nav-drawer .auth-account--drawer .auth-account__link:hover, body[data-ui-theme='light'] .audit-nav-drawer .auth-account--drawer .auth-account__logout:hover { color: var(--auth-bronze-ink); background: rgba(118, 80, 21, .08); }
body#top #site-nav.on-pearl .auth-account__trigger { color: #1a1a1a; border-color: rgba(26,26,26,.2); background: rgba(26,26,26,.04); }

/* ===== Responsive ===== */
@media (max-width: 1150px) {
  body:not(#top) .nav-auth-desktop { display: none; }
  body:not(#top) .nav-auth-drawer:not([hidden]) { display: inline-flex; }
}
@media (max-width: 1439px) {
  body#top .nav-auth-desktop { display: none; }
  body#top .nav-auth-drawer:not([hidden]) { display: inline-flex; }
}
@media (max-width: 1279px) {
  .login-page .audit-nav-links, .login-page .audit-nav-actions > .audit-nav-toggle, .login-page .audit-nav-actions > .audit-nav-contact, .login-page .nav-auth-desktop { display: none; }
  .login-page .audit-nav-menu { display: inline-flex; }
  .login-page .audit-nav-drawer:not([hidden]), .login-page .nav-auth-drawer:not([hidden]) { display: flex; }
}
@media (max-width: 960px) {
  .login-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; width: min(100%, 560px); min-height: auto; padding: 40px 24px 32px; }
  .login-hero { max-width: none; padding: 0 0 0 24px; }
  .login-hero h1 { margin: 16px 0 12px; font-size: clamp(34px, 7vw, 46px); }
  .login-card-shell { max-width: 520px; }
}
@media (max-width: 640px) {
  .auth-account__name { max-width: min(50vw, 220px); }
  .login-layout { gap: 24px; padding: 24px 16px 28px; }
  .login-hero { padding-left: 16px; }
  .login-hero h1 { font-size: clamp(32px, 8vw, 40px); }
  .login-hero__lead { margin-bottom: 22px; font-size: 14px; }
  .login-hero__props { gap: 10px; }
  .login-card { padding: 26px 22px; }
  .login-card h2 { font-size: 25px; }
  .login-card__actions { align-items: flex-start; flex-direction: column; }
  .login-card__trust { align-items: flex-start; }
  .login-footer { padding: 0 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-entry, .login-google, .auth-account__trigger svg { transition: none; animation: none; }
  .auth-entry:hover, .login-google:hover { transform: none; }
  .login-page, body.login-page[data-ui-theme='light'] { background-attachment: scroll; }
}

.login-footer a { text-decoration: none; }
