/* ==========================================================
   auth.css – Giao diện Đăng nhập / Đăng ký (bố cục 2 cột)
   Dùng kèm site.css (tái sử dụng biến màu, nút, toast)
   ========================================================== */
.auth-page {
  --brand: #c8102e; --brand-600: #a50d26; --brand-50: #fdf1f2;
  --ink: #1c1b1f; --ink-2: #5b5760; --ink-3: #8c8791;
  --line: #e6e1dc; --line-2: #f3efea; --surface: #ffffff;
  --gold: #c9971c; --gold-50: #fbf4e2;
  --ok: #177245; --warn: #9a6200; --danger: #b3261e;
  --font-hanzi: "Noto Serif SC", "Songti SC", "SimSun", serif;
  color: var(--ink);
}
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: #f5f6f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-page { background: var(--bg); } }

.auth-shell { width: 100%; max-width: 920px; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(28, 27, 31, .28); }
.auth-shell.wide { max-width: 1000px; grid-template-columns: 5fr 6fr; }

/* ---------- Cột trái: thương hiệu ---------- */
.auth-brand { position: relative; overflow: hidden; background: #fde8ec; padding: 44px 40px; display: flex; flex-direction: column; border-right: 1px solid #f6d3da; }
.auth-brand::before { content: ""; position: absolute; width: 340px; height: 340px; left: 50%; top: 38%; transform: translate(-40%, -50%); background: radial-gradient(circle, rgba(200, 16, 46, .16), transparent 65%); filter: blur(10px); pointer-events: none; }
.auth-brand::after { content: "汉"; position: absolute; right: -24px; bottom: -40px; font-family: var(--font-hanzi); font-size: 220px; line-height: 1; color: rgba(200, 16, 46, .06); font-weight: 700; pointer-events: none; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--brand); text-decoration: none; }
.auth-logo:hover { color: var(--brand); }
.auth-logo .logo-mark { width: 64px; height: 64px; border-radius: 18px; font-size: 36px; }
.auth-logo b { font-size: 1.15rem; font-weight: 800; letter-spacing: .08em; }
.auth-brand h1 { font-size: 1.75rem; color: #1c1b1f; margin: 0 0 10px; }
.auth-brand .lead { color: #5b5760; font-size: .93rem; margin: 0; max-width: 320px; }
.auth-features { list-style: none; padding: 0; margin: auto 0 0; padding-top: 40px; display: grid; gap: 16px; }
.auth-features li { display: flex; align-items: center; gap: 14px; color: #3b363d; font-size: .93rem; }
.auth-features .ic { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--brand); box-shadow: 0 4px 12px -6px rgba(200, 16, 46, .45); flex-shrink: 0; }
.auth-features .ic svg { width: 17px; height: 17px; }

/* ---------- Cột phải: form ---------- */
.auth-form { padding: 44px 44px 36px; }
.auth-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.auth-form-head h2 { font-size: 1.75rem; margin: 0; }
.back-home { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .88rem; white-space: nowrap; margin-top: 8px; }
.back-home:hover { color: var(--brand); }
.back-home svg { width: 15px; height: 15px; }
.auth-sub { color: var(--ink-2); font-size: .93rem; margin: 8px 0 24px; }

.auth-form .field { margin-bottom: 18px; }
.auth-form label { font-size: .88rem; }
.input-icon { position: relative; }
.input-icon > svg.lead-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.input-icon input, .input-icon select { display: block; width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background-color: var(--surface); border: 1px solid var(--line); padding: 12px 14px 12px 40px; border-radius: 12px; min-height: 48px; transition: border-color .15s, box-shadow .15s; }
.input-icon input:focus, .input-icon select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 16, 46, .15); }
.input-icon input::placeholder { color: var(--ink-3); }
.input-icon select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238c8791' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input-icon:focus-within > svg.lead-ic { color: var(--brand); }
.input-icon .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.input-icon .eye:hover { background: var(--line-2); color: var(--ink); }
.input-icon .eye svg { width: 18px; height: 18px; }
.input-icon.has-eye input { padding-right: 46px; }

/* Dropdown vai trò */
.role-select select { font-weight: 600; background-color: var(--surface); }
.role-hint { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }

.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 22px; font-size: .88rem; }
.auth-row a { font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: .88rem; line-height: 1.45; color: var(--ink-2); margin: 0; cursor: pointer; text-align: left; }
.auth-page .check input[type=checkbox] { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--brand); cursor: pointer; }
.auth-row .check-terms { justify-content: flex-start; }
.check a { font-weight: 600; color: var(--brand); white-space: nowrap; }
.auth-row > a { color: var(--brand); white-space: nowrap; }

.auth-form .btn.block { padding: 14px 18px; font-size: 1rem; border-radius: 12px; }
.auth-foot { text-align: center; margin: 22px 0 0; color: var(--ink-2); font-size: .9rem; }
.auth-foot a { font-weight: 700; }
.pw-meter { height: 4px; border-radius: 2px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 6px; display: none; }
.field.invalid .field-error { display: block; }
.field.invalid input { border-color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth-shell, .auth-shell.wide { grid-template-columns: 1fr; max-width: 520px; }
  .auth-brand { padding: 28px 24px; border-right: none; border-bottom: 1px solid #f6d3da; text-align: center; align-items: center; }
  .auth-brand .lead { margin: 0 auto; }
  .auth-logo { margin-bottom: 14px; }
  .auth-logo .logo-mark { width: 52px; height: 52px; font-size: 30px; }
  .auth-brand h1 { font-size: 1.4rem; }
  .auth-features { display: none; }
  .auth-form { padding: 28px 22px; }
}
@media (max-width: 480px) { .form-2col { grid-template-columns: 1fr; } .auth-page { padding: 0; } .auth-shell { border-radius: 0; border: none; } }
/* ---------- Khối thương hiệu: logo + tên trung tâm (căn giữa) ---------- */
html body .auth-brand { align-items: center; text-align: center; padding: 40px 36px 34px; }
html body .auth-lockup { display: flex; flex-direction: column; align-items: center; width: 100%; margin: 8px 0 28px; }
html body .auth-lockup .auth-logo { margin: 0 0 18px; }
html body .auth-lockup .auth-logo img.logo-mark { width: 112px; height: 112px; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
html body .auth-lockup .auth-logo:hover img.logo-mark { transform: scale(1.04) rotate(-3deg); }
html body .auth-eb { font-family: "Montserrat", "Be Vietnam Pro", sans-serif; font-size: .82rem; font-weight: 800; line-height: 1.5; letter-spacing: .2em; margin-bottom: 8px; text-transform: uppercase; color: #4a5f99; }
html body .auth-lockup h1 { margin: 0; font-size: 2.4rem; line-height: 1.3; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: #1f3c88; }
html body .auth-div { display: flex; align-items: center; gap: 8px; width: 150px; margin: 14px 0 10px; }
html body .auth-div::before, html body .auth-div::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #e2b23c); }
html body .auth-div::after { background: linear-gradient(90deg, #e2b23c, transparent); }
html body .auth-div i { width: 7px; height: 7px; background: #e2b23c; transform: rotate(45deg); border-radius: 1px; }
html body .auth-zh { font-family: var(--font-hanzi); font-size: 1.05rem; font-weight: 700; letter-spacing: .18em; color: #b8860b; }
html body .auth-lockup .lead { margin: 16px auto 0; max-width: 330px; color: #5b6478; font-size: .92rem; line-height: 1.6; }
html body .auth-features { width: 100%; max-width: 340px; margin: auto auto 0; padding: 16px 18px; gap: 12px; text-align: left;
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(31, 60, 136, .1); border-radius: 16px; backdrop-filter: blur(6px); }
html body .auth-features li { font-size: .9rem; }
html body .auth-features .ic { color: #1f3c88; box-shadow: 0 4px 12px -6px rgba(31, 60, 136, .45); }
@media (max-width: 860px) {
  html body .auth-brand { padding: 26px 20px 22px; }
  html body .auth-lockup .auth-logo { margin-bottom: 12px; }
  html body .auth-lockup .auth-logo img.logo-mark { width: 80px; height: 80px; }
  html body .auth-lockup h1 { font-size: 1.8rem; }
  html body .auth-eb { font-size: .72rem; }
  html body .auth-div { margin: 10px 0 8px; }
  html body .auth-lockup .lead { display: none; }
}