/**
 * auth.css — Trang Đăng nhập / Đăng ký phong cách ngành in chuyên nghiệp.
 * Split-screen: form bên trái, visual panel ngành in (halftone, CMYK, máy in) bên phải.
 */

:root {
  --brand: #4f46e5;
  --accent: #6366f1;
}

/* ── Reset basics ────────────────────────────────────────────── */
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #f8fafc;
  color: #0f172a;
}
html.dark body { background: #0b1020; color: #e2e8f0; }

/* ── Split-screen shell ──────────────────────────────────────── */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 520px) 1fr;
  min-height: 100vh;
  width: 100%;
}

/* ── LEFT — Form panel ───────────────────────────────────────── */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 2rem 2.75rem;
  position: relative;
  z-index: 1;
}
html.dark .auth-form-panel { background: #0b1020; }

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: auto;
}
.auth-brand { display: flex; align-items: center; gap: .7rem; }
.auth-logo {
  width: 2.4rem; height: 2.4rem;
  border-radius: .65rem;
  background: var(--brand, #4f46e5);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--brand, #4f46e5) 28%, transparent);
}
.auth-brand-name {
  font-size: 1rem; font-weight: 700;
  color: #0f172a; letter-spacing: -.01em;
  line-height: 1.1;
}
html.dark .auth-brand-name { color: #f1f5f9; }
.auth-brand-tag {
  font-size: .72rem; color: #94a3b8;
  letter-spacing: .01em;
}

.auth-form-center {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 2rem 0;
}
.auth-form-inner {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.auth-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.025em;
  margin: 0 0 .5rem;
  line-height: 1.15;
}
html.dark .auth-title { color: #f1f5f9; }
.auth-subtitle {
  font-size: .9rem;
  color: #64748b;
  margin: 0 0 1.75rem;
  line-height: 1.55;
}
html.dark .auth-subtitle { color: #94a3b8; }

/* ── Alert ───────────────────────────────────────────────────── */
.auth-alert {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: .55rem;
  padding: .65rem .85rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}
html.dark .auth-alert {
  background: rgba(127, 29, 29, .25);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, .4);
}

/* ── Form ────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.auth-field { display: flex; flex-direction: column; gap: .35rem; }
.auth-field label {
  font-size: .78rem;
  font-weight: 500;
  color: #475569;
  letter-spacing: .005em;
}
html.dark .auth-field label { color: #cbd5e1; }

.auth-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: .6rem;
  padding: 0 .65rem;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .02);
}
html.dark .auth-input-wrap { background: #1e293b; border-color: #334155; }
.auth-input-wrap:hover { border-color: #c2cee0; }
html.dark .auth-input-wrap:hover { border-color: #475569; }
.auth-input-wrap:focus-within {
  border-color: var(--brand, #4f46e5);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, .02),
    0 0 0 3px color-mix(in srgb, var(--brand, #4f46e5) 16%, transparent);
}
.auth-input-icon {
  font-size: .95rem;
  color: #94a3b8;
  flex-shrink: 0;
  margin-right: .55rem;
  width: 1rem;
  text-align: center;
}
.auth-input-wrap input,
.auth-input-wrap select {
  flex: 1;
  padding: .65rem 0;
  font-size: .9rem;
  border: none;
  background: transparent;
  outline: none;
  color: #0f172a;
  font-family: inherit;
  min-width: 0;
}
html.dark .auth-input-wrap input,
html.dark .auth-input-wrap select { color: #f1f5f9; }
.auth-input-wrap input::placeholder { color: #94a3b8; }
.auth-input-wrap select { padding-right: .35rem; cursor: pointer; }

.auth-input-action {
  background: none; border: none;
  color: #94a3b8; cursor: pointer;
  font-size: .9rem; padding: .25rem .4rem;
  flex-shrink: 0;
  transition: color .15s;
}
.auth-input-action:hover { color: var(--brand, #4f46e5); }

.auth-field-meta {
  font-size: .7rem;
  color: #b45309;
  margin: .25rem 0 0;
  line-height: 1.4;
}

/* ── Primary submit button ──────────────────────────────────── */
.auth-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--brand, #4f46e5);
  color: #fff;
  border: none;
  border-radius: .6rem;
  padding: .75rem 1rem;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, filter .15s;
  margin-top: .35rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, .1),
    0 0 0 1px color-mix(in srgb, var(--brand, #4f46e5) 30%, transparent) inset;
}
.auth-btn-primary:hover {
  filter: brightness(.95);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand, #4f46e5) 35%, transparent);
}
.auth-btn-primary:active { transform: translateY(0); filter: brightness(.92); }
.auth-btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.auth-btn-arrow { transition: transform .15s; }
.auth-btn-primary:hover .auth-btn-arrow { transform: translateX(3px); }

/* ── Divider ─────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0 1rem;
  font-size: .72rem;
  color: #94a3b8;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e6edf5;
}
html.dark .auth-divider::before,
html.dark .auth-divider::after { background: #1e293b; }

/* ── Switch link ─────────────────────────────────────────────── */
.auth-switch {
  text-align: center;
  font-size: .88rem;
  color: #64748b;
}
html.dark .auth-switch { color: #94a3b8; }
.auth-switch-link {
  color: var(--brand, #4f46e5);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch-link:hover { text-decoration: underline; }

/* ── Default account hint ────────────────────────────────────── */
.auth-default-account {
  margin-top: 1.5rem;
  padding: .6rem .8rem;
  border: 1px dashed #d9e2ee;
  border-radius: .55rem;
  font-size: .72rem;
  color: #64748b;
  text-align: center;
  background: #fafbfc;
}
html.dark .auth-default-account {
  background: rgba(30, 41, 59, .4);
  border-color: #334155;
  color: #94a3b8;
}
.auth-default-account code {
  background: #fff;
  padding: .1rem .35rem;
  border-radius: .3rem;
  font-size: .72rem;
  color: #0f172a;
  border: 1px solid #e6edf5;
}
html.dark .auth-default-account code {
  background: #0f172a; color: #e2e8f0; border-color: #334155;
}
.auth-default-label { color: #94a3b8; margin-right: .25rem; }

/* ── Footer ──────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  font-size: .72rem;
  color: #94a3b8;
  margin-top: auto;
  padding-top: 1rem;
}

/* ═══════════════════════════════════════════════════════════════ */
/* ═══ RIGHT — Visual panel (ngành in) ═══════════════════════════ */
/* ═══════════════════════════════════════════════════════════════ */

.auth-visual-panel {
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2.5rem;
  background:
    linear-gradient(135deg,
      var(--brand, #4f46e5) 0%,
      color-mix(in srgb, var(--brand, #4f46e5) 72%, #0f172a) 100%);
}

/* Halftone dot pattern overlay — signature offset printing */
.auth-halftone {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .12) 1.2px, transparent 1.6px);
  background-size: 18px 18px;
  background-position: 0 0;
  mix-blend-mode: screen;
  opacity: .9;
  pointer-events: none;
}

/* Diagonal stripes (top accent) */
.auth-stripes {
  position: absolute;
  top: -20%; right: -10%;
  width: 60%; height: 50%;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, .055) 0,
    rgba(255, 255, 255, .055) 8px,
    transparent 8px,
    transparent 16px
  );
  transform: rotate(15deg);
  pointer-events: none;
}

/* Floating CMYK dots */
.auth-cmyk {
  position: absolute;
  border-radius: 9999px;
  filter: blur(.3px);
  mix-blend-mode: screen;
  opacity: .6;
  pointer-events: none;
}
.cmyk-c { width: 140px; height: 140px; background: #00bcd4; top: 8%;  left: 5%;  }
.cmyk-m { width: 110px; height: 110px; background: #e91e63; top: 28%; right: 12%; }
.cmyk-y { width: 130px; height: 130px; background: #ffc107; bottom: 18%; left: 12%; opacity: .55; }
.cmyk-k { width: 90px;  height: 90px;  background: #0f172a; bottom: 8%; right: 8%; opacity: .35; mix-blend-mode: multiply; }

/* Paper sheets — floating decorative */
.auth-paper {
  position: absolute;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 4px;
  pointer-events: none;
}
.paper-1 { width: 80px;  height: 110px; top: 14%; right: 18%; transform: rotate(8deg); }
.paper-2 { width: 60px;  height: 80px;  bottom: 24%; right: 28%; transform: rotate(-12deg); background: rgba(255,255,255,.05); }
.paper-3 { width: 70px;  height: 95px;  top: 55%; left: 8%; transform: rotate(18deg); }

/* Main illustration */
.auth-illustration-wrap {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .2));
}
.auth-illustration {
  width: 100%;
  max-width: 340px;
  height: auto;
  animation: auth-float 6s ease-in-out infinite;
}
@keyframes auth-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Visual panel content */
.auth-visual-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 460px;
}
.auth-quote-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
  line-height: 1.2;
  color: #fff;
}
.auth-quote-text {
  font-size: .92rem;
  color: rgba(255, 255, 255, .85);
  line-height: 1.55;
  margin: 0 0 1.5rem;
}
.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  text-align: left;
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .92);
  padding: .55rem .85rem;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: .55rem;
  backdrop-filter: blur(8px);
}
.feat-ico {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════ */
/* ═══ Responsive ═════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════ */

/* Tablet — hide some decorations */
@media (max-width: 1180px) {
  .auth-shell { grid-template-columns: minmax(0, 460px) 1fr; }
  .auth-form-panel { padding: 2rem 2rem; }
  .auth-quote-title { font-size: 1.4rem; }
  .auth-features li { font-size: .8rem; }
  .paper-1, .paper-2, .paper-3 { display: none; }
}

/* Mobile — single column, hide visual panel */
@media (max-width: 768px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual-panel { display: none; }
  .auth-form-panel {
    padding: 1.5rem 1.25rem;
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--brand, #4f46e5) 5%, #f8fafc) 0%,
        #f8fafc 100%);
  }
  .auth-form-center { padding: 1.5rem 0; }
  .auth-title { font-size: 1.55rem; }
  .auth-form-inner { max-width: 100%; }
  .auth-row { grid-template-columns: 1fr; }
}
