*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #7ABA50;
  --dark: #0f172a;
  --gray: #64748b;
  --gray-light: #f1f5f9;
  --white: #ffffff;
  --radius-sm: 8px;
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--dark);
  line-height: 1.6;
  background: var(--white);
}

/* ── Main Page (minimal) ── */
.main-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fafbfc;
}

.main-logo svg {
  display: block;
  margin-bottom: 12px;
}

.main-tagline {
  color: #94a3b8;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Auth Gate ── */
#auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Animated orbs */
.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 12s ease-in-out infinite;
}

.auth-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.auth-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #059669 0%, transparent 70%);
  bottom: -5%;
  right: -5%;
  animation-delay: -4s;
  animation-duration: 15s;
}

.auth-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #34d399 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
  animation-duration: 10s;
  opacity: 0.25;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* Layout */
.auth-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  width: 820px;
  max-width: 95vw;
  min-height: 480px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
  animation: cardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Left brand panel */
.auth-brand {
  flex: 1;
  background: linear-gradient(160deg, #064e3b 0%, #065f46 40%, #047857 100%);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(52,211,153,0.15) 0%, transparent 60%);
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 60%);
}

.auth-brand-content {
  position: relative;
  z-index: 2;
}

.auth-brand-logo {
  margin-bottom: 28px;
}

.auth-brand-logo svg {
  display: block;
  opacity: 0.95;
}

.auth-brand-tagline {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 40px;
}

.auth-brand-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.auth-stat-num {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #6ee7b7;
}

.auth-stat-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.auth-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.15);
}

/* Right login panel */
.auth-card {
  flex: 1;
  background: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card-inner {
  padding: 48px 40px;
  width: 100%;
  max-width: 360px;
}

.auth-logo-dark {
  margin-bottom: 24px;
}

.auth-logo-dark svg {
  display: block;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.auth-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.auth-btn:hover {
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16,185,129,0.15);
  transform: translateY(-1px);
}

.auth-btn:hover::before {
  opacity: 1;
}

.auth-btn svg,
.auth-btn span {
  position: relative;
  z-index: 1;
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #64748b;
  font-size: 0.9rem;
  padding: 14px 0;
}

.auth-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-error {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fef2f2;
  border-radius: 10px;
  border: 1px solid #fecaca;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
  color: #94a3b8;
  font-size: 0.78rem;
}

.auth-footer svg {
  color: #10b981;
  flex-shrink: 0;
}

/* Mobile */
@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
    min-height: auto;
    max-height: 95vh;
    overflow-y: auto;
  }

  .auth-brand {
    padding: 32px 28px;
  }

  .auth-brand-logo svg {
    width: 140px;
    height: auto;
  }

  .auth-brand-tagline {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }

  .auth-brand-stats {
    gap: 16px;
  }

  .auth-stat-num {
    font-size: 1.1rem;
  }

  .auth-card-inner {
    padding: 32px 28px;
  }

  .auth-title {
    font-size: 1.25rem;
  }
}
