/* ===== SHARED AUTH LAYOUT (login, signup, forgot, reset) ===== */

body.auth-page {
  background-image: none;
  overflow: hidden;
}
body.auth-page::before,
body.auth-page::after { display: none; }

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(40px, 6vw, 96px);
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.auth-brand__grid {
  position: absolute;
  inset: -48px 0 0 -48px;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 40% 40%, black 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 80% at 40% 40%, black 30%, transparent 100%);
  animation: grid-drift 30s linear infinite alternate;
  pointer-events: none;
}
@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(48px, 48px, 0); }
}
.auth-brand__glow {
  position: absolute;
  top: 15%;
  left: -10%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-rgb), 0.14) 0%, transparent 65%);
  animation: glow-breathe 10s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.8; transform: translate3d(0, 0, 0) scale(1); }
  50%      { opacity: 1; transform: translate3d(4%, -3%, 0) scale(1.08); }
}
.auth-brand__content { position: relative; z-index: 1; max-width: 460px; }
.auth-brand__heading {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}
.auth-brand__heading .accent { color: var(--brand); }
.auth-brand__sub {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 40ch;
}
.auth-checklist { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 48px; }
.auth-checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(10px);
  animation: item-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.auth-checklist .check {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(var(--brand-rgb), 0.12);
  border: 1px solid rgba(var(--brand-rgb), 0.35);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-checklist .check svg {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: check-draw 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.auth-checklist li:nth-child(1) { animation-delay: 0.55s; }
.auth-checklist li:nth-child(2) { animation-delay: 0.70s; }
.auth-checklist li:nth-child(3) { animation-delay: 0.85s; }
.auth-checklist li:nth-child(4) { animation-delay: 1.00s; }
.auth-checklist li:nth-child(5) { animation-delay: 1.15s; }
.auth-checklist li:nth-child(1) .check svg { animation-delay: 0.85s; }
.auth-checklist li:nth-child(2) .check svg { animation-delay: 1.00s; }
.auth-checklist li:nth-child(3) .check svg { animation-delay: 1.15s; }
.auth-checklist li:nth-child(4) .check svg { animation-delay: 1.30s; }
.auth-checklist li:nth-child(5) .check svg { animation-delay: 1.45s; }
@keyframes item-in { to { opacity: 1; transform: translateY(0); } }
@keyframes check-draw { to { stroke-dashoffset: 0; } }
.auth-brand__security {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0;
  animation: item-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1.4s forwards;
}
.auth-brand__security svg { color: var(--brand); flex-shrink: 0; }

.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background:
    radial-gradient(520px circle at 70% 30%, rgba(var(--brand-rgb), 0.05), transparent 70%),
    var(--surface-raised);
  overflow-y: auto;
}
.auth-form-card {
  width: 100%;
  max-width: 440px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 40px);
  box-shadow: var(--shadow-xl), 0 0 80px rgba(var(--brand-rgb), 0.05);
  opacity: 0;
  transform: translateY(16px);
  animation: card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}
@keyframes card-in { to { opacity: 1; transform: translateY(0); } }
.auth-form-card__logo {
  display: block;
  height: 48px;
  width: auto;
  border-radius: 10px;
  margin-bottom: 24px;
}
.auth-form-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-form-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 28px;
}
.auth-form-card .field { margin-bottom: 20px; }
.auth-form-card .field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.auth-form-card .field-row .field-label { margin-bottom: 0; }
.auth-form-card .btn-primary { width: 100%; margin-top: 8px; padding: 13px 28px; }
.forgot-link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.forgot-link:hover { color: var(--brand); }
.auth-form-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.auth-form-footer a { color: var(--brand); text-decoration: none; }
.auth-form-footer a:hover { text-decoration: underline; }
.error-msg {
  color: #ff6b6b;
  font-size: var(--text-sm);
  background: rgba(var(--danger-rgb), 0.08);
  border: 1px solid rgba(var(--danger-rgb), 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: none;
}
.error-msg.show { display: block; }
.success-msg {
  color: var(--brand);
  font-size: var(--text-sm);
  background: rgba(var(--brand-rgb), 0.08);
  border: 1px solid rgba(var(--brand-rgb), 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: none;
  line-height: 1.5;
}
.success-msg.show { display: block; }

@media (max-width: 860px) {
  body.auth-page { overflow: auto; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; min-height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand__grid, .auth-brand__glow { animation: none; }
  .auth-form-card { animation: none; opacity: 1; transform: none; }
  .auth-checklist li, .auth-brand__security { animation: none; opacity: 1; transform: none; }
  .auth-checklist .check svg { animation: none; stroke-dashoffset: 0; }
}
