/* ── auth.css — Login / Register pages ─────────────────────────
   Import AFTER main.css. Contains only auth-specific styles.
   ────────────────────────────────────────────────────────────── */

/* ── Page shell ─────────────────────────────────────────────── */
.auth-body {
  display:         flex;
  align-items:     center;
  justify-content: center;
  min-height:      100vh;
  overflow:        hidden;
  position:        relative;
  background:      var(--bg-deep);
}

/* ── Animated grid ──────────────────────────────────────────── */
.bg-grid {
  position:         fixed;
  inset:            0;
  background-image:
    linear-gradient(rgba(0,212,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.025) 1px, transparent 1px);
  background-size:  40px 40px;
  animation:        authGridShift 20s linear infinite;
  pointer-events:   none;
  z-index:          0;
}
@keyframes authGridShift {
  0%   { transform: translate(0,0); }
  100% { transform: translate(40px,40px); }
}

/* ── Ambient glow orbs ──────────────────────────────────────── */
.orb {
  position:       fixed;
  border-radius:  50%;
  filter:         blur(80px);
  pointer-events: none;
  animation:      orbFloat 8s ease-in-out infinite alternate;
  z-index:        0;
}
.orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(0,212,255,0.07), transparent 70%);
  top: -100px; right: -80px;
}
.orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,255,136,0.05), transparent 70%);
  bottom: -80px; left: -60px;
  animation-delay: -4s;
}
@keyframes orbFloat {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(16px,-16px) scale(1.05); }
}

/* ── CRT scan lines ─────────────────────────────────────────── */
.scanlines {
  position:       fixed;
  inset:          0;
  background:     repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.07) 2px, rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
  z-index:        0;
}

/* ── Two-column layout ──────────────────────────────────────── */
.auth-layout {
  display:               grid;
  grid-template-columns: 1fr 480px;
  width:                 100%;
  max-width:             1080px;
  padding:               0 2.5rem;
  gap:                   4rem;
  align-items:           center;
  position:              relative;
  z-index:               1;
}

/* ── Left: branding ─────────────────────────────────────────── */
.brand-panel {
  animation: authFadeUp 0.7s ease both;
}

.brand-logo {
  display:       flex;
  align-items:   center;
  gap:           0.75rem;
  margin-bottom: 2.5rem;
}
.logo-hex { width: 44px; height: 44px; }
.logo-hex svg { width: 100%; height: 100%; }

.brand-wordmark {
  font-family:    var(--font-display);
  font-size:      1.4rem;
  font-weight:    800;
  letter-spacing: 0.04em;
  color:          var(--text-primary);
}
.brand-wordmark span { color: var(--accent-cyan); }

.brand-headline {
  font-family:    var(--font-display);
  font-size:      clamp(1.9rem, 3vw, 2.6rem);
  font-weight:    800;
  line-height:    1.15;
  letter-spacing: -0.02em;
  margin-bottom:  1.25rem;
}
.brand-headline em {
  font-style: normal;
  color:       var(--accent-cyan);
}

.brand-sub {
  color:         var(--text-secondary);
  font-size:     0.88rem;
  line-height:   1.75;
  max-width:     380px;
  margin-bottom: 2.5rem;
}

/* ── Stats strip ────────────────────────────────────────────── */
.stats-strip {
  display:     flex;
  gap:         2rem;
  flex-wrap:   wrap;
}
.stat-item {
  display:        flex;
  flex-direction: column;
  gap:            0.2rem;
  animation:      authFadeUp 0.8s ease both;
}
.stat-item:nth-child(1) { animation-delay: 0.15s; }
.stat-item:nth-child(2) { animation-delay: 0.25s; }
.stat-item:nth-child(3) { animation-delay: 0.35s; }

.stat-num {
  font-family: var(--font-display);
  font-size:   1.5rem;
  font-weight: 700;
  color:       var(--accent-cyan);
}
/* Blinking cursor on live stats */
.stat-num::after {
  content:   '_';
  animation: authBlink 1.2s step-end infinite;
  opacity:   0.6;
}
@keyframes authBlink {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 0; }
}
.stat-lbl {
  font-size:      0.68rem;
  color:          var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── Auth card ──────────────────────────────────────────────── */
.auth-card {
  background:    var(--bg-card);
  border:        1px solid var(--border);
  border-radius: 16px;
  padding:       2.5rem;
  position:      relative;
  overflow:      hidden;
  animation:     authFadeUp 0.6s ease both;
  box-shadow:    0 0 0 1px rgba(0,212,255,0.04),
                 0 24px 48px rgba(0,0,0,0.5),
                 inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Top glow edge */
.auth-card::before {
  content:  '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.45;
}

/* Top-right corner bracket */
.auth-card::after {
  content:      '';
  position:     absolute;
  top: 12px; right: 12px;
  width: 8px; height: 8px;
  border-top:   1.5px solid var(--accent-cyan);
  border-right: 1.5px solid var(--accent-cyan);
  opacity:      0.35;
}

/* Bottom-left corner bracket */
.corner-bl {
  position:      absolute;
  bottom: 12px; left: 12px;
  width: 8px; height: 8px;
  border-bottom: 1.5px solid var(--text-muted);
  border-left:   1.5px solid var(--text-muted);
  opacity:       0.4;
}

/* ── Card header ────────────────────────────────────────────── */
.auth-card-header { margin-bottom: 2rem; }

.auth-card-title {
  font-family:    var(--font-display);
  font-size:      1.4rem;
  font-weight:    800;
  margin-bottom:  0.3rem;
  letter-spacing: -0.01em;
}
.auth-card-sub {
  color:     var(--text-secondary);
  font-size: 0.82rem;
}

/* ── Alert ──────────────────────────────────────────────────── */
.alert-error {
  display:       flex;
  align-items:   center;
  gap:           0.6rem;
  background:    rgba(255,68,102,0.08);
  border:        1px solid rgba(255,68,102,0.25);
  border-radius: 8px;
  color:         #ff7090;
  padding:       0.75rem 1rem;
  font-size:     0.82rem;
  margin-bottom: 1.25rem;
  animation:     authShake 0.3s ease;
}
.alert-icon { font-size: 0.85rem; flex-shrink: 0; }

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}

/* ── Input group ────────────────────────────────────────────── */
.input-wrap { position: relative; }

.input-icon {
  position:       absolute;
  left:           0.875rem;
  top:            50%;
  transform:      translateY(-50%);
  color:          var(--text-muted);
  font-size:      0.8rem;
  pointer-events: none;
  transition:     color 0.2s;
}

.form-input {
  padding-left: 2.5rem !important;  /* override main.css for icon offset */
}

.form-input.input-error {
  border-color: rgba(255,68,102,0.5);
  background:   rgba(255,68,102,0.03);
}

/* ── Form meta row ──────────────────────────────────────────── */
.form-meta {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   1.5rem;
  font-size:       0.78rem;
}

.checkbox-wrap {
  display:     flex;
  align-items: center;
  gap:         0.45rem;
  color:       var(--text-secondary);
  cursor:      pointer;
  user-select: none;
}
.checkbox-wrap input[type="checkbox"] {
  appearance:    none;
  width:         14px; height: 14px;
  border:        1px solid var(--border);
  border-radius: 3px;
  background:    var(--bg-panel);
  cursor:        pointer;
  position:      relative;
  flex-shrink:   0;
  transition:    background 0.15s, border-color 0.15s;
}
.checkbox-wrap input[type="checkbox"]:checked {
  background:   var(--accent-cyan);
  border-color: var(--accent-cyan);
}
.checkbox-wrap input[type="checkbox"]:checked::after {
  content:     '✓';
  position:    absolute;
  top: -1px; left: 1px;
  font-size:   10px;
  color:       var(--bg-deep);
  font-weight: 700;
}

.form-link {
  color:      var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.form-link:hover { color: var(--accent-cyan); }

/* ── Submit button ──────────────────────────────────────────── */
.btn-submit {
  width:          100%;
  background:     var(--accent-cyan);
  color:          var(--bg-deep);
  border:         none;
  border-radius:  8px;
  font-family:    var(--font-mono);
  font-size:      0.875rem;
  font-weight:    700;
  padding:        0.85rem;
  cursor:         pointer;
  letter-spacing: 0.05em;
  transition:     opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  position:       relative;
  overflow:       hidden;
  margin-bottom:  1.25rem;
}
/* Shimmer effect */
.btn-submit::before {
  content:    '';
  position:   absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: rgba(255,255,255,0.15);
  transform:  skewX(-20deg);
  transition: left 0.4s ease;
}
.btn-submit:hover::before      { left: 130%; }
.btn-submit:hover   { opacity: 0.88; box-shadow: 0 4px 20px rgba(0,212,255,0.28); }
.btn-submit:active  { transform: scale(0.99); }
.btn-submit:disabled{
  opacity: 0.6;
  cursor:  not-allowed;
  pointer-events: none;
}

/* ── Divider ────────────────────────────────────────────────── */
.auth-divider {
  display:       flex;
  align-items:   center;
  gap:           0.75rem;
  margin-bottom: 1.25rem;
  color:         var(--text-muted);
  font-size:     0.72rem;
}
.auth-divider::before, .auth-divider::after {
  content:    '';
  flex:       1;
  height:     1px;
  background: var(--border);
}

/* ── Register / footer link ─────────────────────────────────── */
.auth-footer-link {
  text-align: center;
  font-size:  0.82rem;
  color:      var(--text-secondary);
}
.auth-footer-link a {
  color:       var(--accent-cyan);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover { text-decoration: underline; }

/* ── Bottom status bar ──────────────────────────────────────── */
.auth-status-bar {
  position:    fixed;
  bottom:      1.5rem;
  left:        50%;
  transform:   translateX(-50%);
  display:     flex;
  align-items: center;
  gap:         0.75rem;
  font-size:   0.68rem;
  color:       var(--text-muted);
  white-space: nowrap;
  z-index:     1;
  animation:   authFadeUp 1s ease 0.5s both;
}
.status-dot {
  width:         6px; height: 6px;
  border-radius: 50%;
  background:    var(--accent-green);
  box-shadow:    0 0 6px var(--accent-green);
  animation:     authPulse 2s ease-in-out infinite;
  flex-shrink:   0;
}
@keyframes authPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent-green); }
  50%       { opacity: 0.4; box-shadow: none; }
}
.status-sep { opacity: 0.4; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 820px) {
  .auth-layout {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 6rem;
    gap:     2rem;
    align-items: start;
    min-height:  100vh;
  }
  .brand-panel { text-align: center; }
  .brand-logo  { justify-content: center; }
  .brand-sub, .stats-strip { margin-left: auto; margin-right: auto; }
  .stats-strip { justify-content: center; }
  .brand-headline { font-size: 1.8rem; }
  .auth-status-bar { display: none; }
}
