/* ============================================================
   AUTH PAGE — EngageDM
   Same design system as landing.css. Covers login + signup.
   ============================================================ */

/* ── CSS variables (mirrors landing.css) ────────────────────── */
:root {
  --ig-grad:     linear-gradient(45deg,  #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  --ig-grad-alt: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  --accent-1: #c13584;
  --accent-2: #e1306c;
  --accent-3: #fd1d1d;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --t-fast: 0.18s ease;
  --t-med:  0.35s ease;
  --t-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-primary:   #0a0a0a;
  --bg-secondary: #111111;
  --bg-card:      #1a1a1a;
  --bg-glass:     rgba(255,255,255,0.05);
  --bg-glass-2:   rgba(255,255,255,0.08);
  --border:       rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --text-primary:   #f5f5f5;
  --text-secondary: #b0b0be;
  --text-muted:     #72728a;
  --shadow-card:  0 4px 40px rgba(0,0,0,0.5);
  --shadow-glow:  0 0 60px rgba(193,53,132,0.25);
  --input-bg:     rgba(255,255,255,0.06);
}

[data-theme="light"] {
  --bg-primary:   #ffffff;
  --bg-secondary: #f7f7fb;
  --bg-card:      #ffffff;
  --bg-glass:     rgba(0,0,0,0.03);
  --bg-glass-2:   rgba(0,0,0,0.05);
  --border:       rgba(0,0,0,0.09);
  --border-hover: rgba(0,0,0,0.2);
  --text-primary:   #0d0d0d;
  --text-secondary: #4a4a5a;
  --text-muted:     #8888a0;
  --shadow-card:  0 4px 40px rgba(0,0,0,0.08);
  --shadow-glow:  0 0 60px rgba(193,53,132,0.12);
  --input-bg:     rgba(0,0,0,0.04);
}

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ── Logo (shared) ───────────────────────────────────────────── */
.logo-flo {
  background: var(--ig-grad-alt);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  letter-spacing: -1px;
}
.logo-gram {
  background: var(--ig-grad-alt);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.auth-logo { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 900; }
.auth-logo-icon { font-size: 22px; }

/* ── Page layout ─────────────────────────────────────────────── */
.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ============================================================
   LEFT PANEL — Brand / animated preview
   ============================================================ */
.auth-brand {
  position: relative;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 56px;
  overflow: hidden;
}

/* Gradient background blobs */
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(131,58,180,0.35) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(253,29,29,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 60% 10%, rgba(252,176,69,0.15) 0%, transparent 60%);
  z-index: 0;
}

/* Grid lines overlay for a tech feel */
.auth-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

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

.auth-brand-headline {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  color: #f5f5f5;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.auth-brand-headline .grad-text {
  background: var(--ig-grad-alt);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-brand-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 340px;
}

/* ── Animated comment → DM flow ──────────────────────────────── */
.auth-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 48px;
  position: relative;
}

.auth-flow-step {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateX(-20px);
}

.auth-flow-step.visible {
  animation: flowStepIn 0.5s var(--t-slow) forwards;
}

@keyframes flowStepIn {
  to { opacity: 1; transform: translateX(0); }
}

.auth-flow-bubble {
  background: var(--bg-glass-2, rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
  max-width: 280px;
  backdrop-filter: blur(10px);
}

.auth-flow-bubble.comment-bubble {
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
}

.auth-flow-bubble.dm-bubble-out {
  background: linear-gradient(135deg, rgba(131,58,180,0.4), rgba(253,29,29,0.3));
  border-color: rgba(193,53,132,0.4);
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  align-self: flex-end;
}

.auth-flow-icon {
  width: 36px; height: 36px;
  background: var(--ig-grad-alt);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(193,53,132,0.4);
}

.auth-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 8px 50px;
  color: rgba(255,255,255,0.3);
  font-size: 18px;
  opacity: 0;
  animation: arrowFade 0.4s ease 1.2s forwards;
}

@keyframes arrowFade { to { opacity: 1; } }

/* ── Stats row ────────────────────────────────────────────────── */
.auth-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.auth-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-stat-val {
  font-size: 22px;
  font-weight: 800;
  background: var(--ig-grad-alt);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.auth-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================================
   RIGHT PANEL — Auth card
   ============================================================ */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg-primary);
  position: relative;
}

/* Theme toggle — top right */
.auth-theme-btn {
  position: absolute;
  top: 24px; right: 24px;
  background: var(--bg-glass-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.auth-theme-btn:hover { background: var(--bg-glass); }

.auth-card {
  width: 100%;
  max-width: 400px;
}

/* Logo — only shown on mobile when left panel is hidden */
.auth-card-logo {
  display: none;
  justify-content: center;
  margin-bottom: 32px;
}

.auth-card-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.auth-card-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1.15;
  text-align: center;
  margin-bottom: 10px;
}

.auth-card-sub {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 36px;
}

/* ── Plan badge (shown when ?plan=pro) ───────────────────────── */
.auth-plan-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(131,58,180,0.15), rgba(252,176,69,0.1));
  border: 1px solid rgba(193,53,132,0.3);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 28px;
  justify-content: center;
  font-weight: 500;
}

/* ── Error banner ────────────────────────────────────────────── */
.auth-error {
  background: rgba(253,29,29,0.1);
  border: 1px solid rgba(253,29,29,0.3);
  border-radius: var(--radius-sm);
  color: #ff6b6b;
  font-size: 13px;
  padding: 12px 16px;
  text-align: center;
  margin-bottom: 20px;
}

/* ── Google button ────────────────────────────────────────────── */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: #ffffff;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #3c4043;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.auth-google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  border-color: #c0c4c8;
}

.auth-google-btn:active { background: #f1f3f4; }

/* Ripple on click */
.auth-google-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(131,58,180,0.06), rgba(253,29,29,0.04));
  opacity: 0;
  transition: opacity var(--t-fast);
}
.auth-google-btn:hover::after { opacity: 1; }

.google-logo {
  width: 20px; height: 20px;
  flex-shrink: 0;
}

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

/* ── Social proof strip ───────────────────────────────────────── */
.auth-social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

.auth-avatars {
  display: flex;
}

.auth-avatars span {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ig-grad-alt);
  border: 2px solid var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  margin-left: -6px;
}
.auth-avatars span:first-child { margin-left: 0; }

/* ── Legal text ───────────────────────────────────────────────── */
.auth-legal {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}
.auth-legal a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-legal a:hover { color: var(--text-primary); }

/* ── Back link ────────────────────────────────────────────────── */
.auth-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--t-fast);
}
.auth-back:hover { color: var(--text-primary); }

/* ── Responsive: hide left panel on tablet/mobile ────────────── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card-logo { display: flex; }
  .auth-panel { min-height: 100vh; }
}

@media (max-width: 480px) {
  .auth-panel { padding: 32px 20px; }
  .auth-card-title { font-size: 26px; }
}
