/* ============================================================
   auth.css — Trang Đăng Nhập / Đăng Ký / Quên Mật Khẩu
   Font: Inter + Nunito | Design: Modern Split Layout
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Nunito:wght@400;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --auth-accent:   #f97316;
  --auth-accent2:  #fb923c;
  --auth-blue:     #3b82f6;
  --auth-dark:     #0f172a;
  --auth-darker:   #020617;
  --auth-text:     #1e293b;
  --auth-muted:    #64748b;
  --auth-border:   #e2e8f0;
  --auth-surface:  #f8fafc;
  --auth-white:    #ffffff;
  --auth-error:    #ef4444;
  --auth-success:  #22c55e;
  --font-body:     'Inter', sans-serif;
  --font-h:        'Nunito', sans-serif;
}

body.auth-body {
  font-family: var(--font-body);
  background: var(--auth-surface);
  color: var(--auth-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Split Layout ─────────────────────────────────────────── */
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ── Left Panel ───────────────────────────────────────────── */
.auth-panel {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}

/* Decorative orbs */
.auth-panel::before {
  content: '';
  position: absolute;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,.25) 0%, transparent 70%);
  top: -80px; left: -80px;
  pointer-events: none;
}
.auth-panel::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 70%);
  bottom: 40px; right: -60px;
  pointer-events: none;
}

.auth-panel--register { background: linear-gradient(145deg, #0c1445 0%, #1a237e 40%, #0f172a 100%); }
.auth-panel--register::before { background: radial-gradient(circle, rgba(99,102,241,.3) 0%, transparent 70%); }

/* Logo */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 60px;
  position: relative;
  z-index: 1;
}
.auth-logo > span {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--auth-accent), #fbbf24);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(249,115,22,.4);
}
.auth-logo strong {
  display: block;
  font-family: var(--font-h);
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: .5px;
}
.auth-logo small {
  display: block;
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Panel content */
.auth-panel__content {
  position: relative;
  z-index: 1;
}
.auth-panel__content h2 {
  font-family: var(--font-h);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.2;
}
.auth-panel__content p {
  color: rgba(255,255,255,.65);
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 32px;
}
.auth-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-features li {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.07);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.auth-features li:hover { background: rgba(255,255,255,.12); }

/* ── Right Form Side ──────────────────────────────────────── */
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--auth-white);
  overflow-y: auto;
}

/* ── Auth Card ────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 460px;
}
.auth-card--narrow { max-width: 400px; }
.auth-card__head { margin-bottom: 32px; }
.auth-card__head h1 {
  font-family: var(--font-h);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--auth-dark);
  margin-bottom: 6px;
}
.auth-card__head p {
  color: var(--auth-muted);
  font-size: .9rem;
}
.auth-card__head a {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 600;
}
.auth-card__head a:hover { text-decoration: underline; }

/* ── Centered Layout ──────────────────────────────────────── */
.auth-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--auth-surface);
}
.auth-logo--center {
  justify-content: center;
  margin: 0 auto 28px;
}

/* ── Form Elements ────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.has-error .form-input { border-color: var(--auth-error) !important; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-label {
  font-size: .83rem;
  font-weight: 600;
  color: var(--auth-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-label a {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 500;
  font-size: .82rem;
}
.req { color: var(--auth-error); }

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .95rem;
  color: var(--auth-muted);
  pointer-events: none;
  z-index: 1;
}
.input-icon-wrap .form-input { padding-left: 42px; flex: 1; }

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--auth-text);
  background: var(--auth-surface);
  border: 1.5px solid var(--auth-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
}
.form-input::placeholder { color: #b0bec5; }
.form-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
  background: var(--auth-white);
}
.form-select { appearance: none; cursor: pointer; }

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  color: var(--auth-muted);
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color .2s;
}
.pw-toggle:hover { color: var(--auth-accent); }

.form-error { color: var(--auth-error); font-size: .78rem; font-weight: 500; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(249,115,22,.35);
}
.btn--primary:hover {
  background: linear-gradient(135deg, #ea6006, var(--auth-accent));
  box-shadow: 0 6px 24px rgba(249,115,22,.5);
  transform: translateY(-1px);
}
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--auth-border);
  color: var(--auth-text);
}
.btn--ghost:hover { border-color: var(--auth-accent); color: var(--auth-accent); background: rgba(249,115,22,.04); }
.btn--full  { width: 100%; }
.btn--lg    { padding: 14px 24px; font-size: .97rem; }
.btn--sm    { padding: 7px 14px; font-size: .82rem; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 500;
}
.alert--success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #16a34a; }
.alert--error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #dc2626; }
.alert--info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #2563eb; }

/* ── Divider ──────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--auth-muted);
  font-size: .82rem;
  margin: 16px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    padding: 32px 24px 40px;
    min-height: auto;
  }
  .auth-panel::before, .auth-panel::after { display: none; }
  .auth-panel__content h2 { font-size: 1.5rem; }
  .auth-logo { margin-bottom: 28px; }
  .auth-form-side { padding: 36px 20px; }
  .form-row { grid-template-columns: 1fr; }
}
