/* ============================================================
   ahafrog — Shared Auth UI Styles
   Matches landing page (index.html): cool black, lime green, same cards & typography
   ============================================================ */

/* Landing-aligned fallbacks when page does not define these */
.af-overlay {
  --af-bg: #08080b;
  --af-card: #0f0f14;
  --af-border: #1c1c2e;
  --af-text: #ffffff;
  --af-text-2: #b0b0c8;
  --af-muted: #7878a0;
  --af-purple: #88ce02;
  --af-purple-light: #c8fb50;
  --af-purple-dim: rgba(136,206,2,0.10);
  --af-glow: rgba(136,206,2,0.30);
  --af-radius: 16px;
  --af-radius-lg: 24px;
  --af-font: 'PixelZH', system-ui, -apple-system, sans-serif;
}

/* ── Overlay (same as landing page background tone) ── */
.af-overlay {
  position: fixed; inset: 0;
  background: rgba(8,8,11,0.82);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.af-overlay.active { opacity: 1; pointer-events: auto; }

/* ── Modal (landing card style: hero-stats-bar / bento card) ── */
.af-modal {
  background: rgba(17,13,32,0.18);
  border: 1px solid var(--border, var(--af-border));
  border-radius: var(--radius-lg, var(--af-radius-lg));
  padding: 32px 28px;
  width: 400px; max-width: 92vw;
  box-shadow: 0 4px 40px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04), 0 0 40px rgba(136,206,2,0.06);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  position: relative;
}
.af-overlay.active .af-modal { transform: translateY(0) scale(1); }

.af-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--text-muted, var(--af-muted));
  font-size: 22px; cursor: pointer; line-height: 1;
  transition: color 0.15s;
}
.af-modal-close:hover { color: var(--text, var(--af-text)); }

.af-modal h2 {
  font-family: var(--font-heading, var(--font-sans, var(--af-font)));
  font-size: 20px; font-weight: 700;
  color: var(--text, var(--af-text));
  letter-spacing: 0.5px;
  margin-bottom: 6px; text-align: center;
}

/* ── Tabs ── */
.af-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px; padding: 3px;
  margin-bottom: 20px;
}
.af-tab {
  flex: 1; padding: 8px 0;
  background: none; border: none;
  border-radius: 10px;
  font-family: var(--font-sans, var(--font, system-ui, sans-serif));
  font-size: 13px; font-weight: 600;
  color: var(--text-muted, #7878a0);
  cursor: pointer; transition: all 0.15s;
}
.af-tab.active {
  background: var(--purple-dim, rgba(136,206,2,0.10));
  color: var(--purple-light, #c8fb50);
}
.af-tab:hover:not(.active) { color: var(--text-2, #b0b0c8); }

/* ── Form ── */
.af-field { margin-bottom: 14px; }
.af-field label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted, #7878a0);
  letter-spacing: 1.5px; margin-bottom: 5px;
}
.af-field input {
  width: 100%; padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #1c1c2e);
  border-radius: 12px;
  color: var(--text, #fff);
  font-family: var(--font, system-ui, sans-serif);
  font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.af-field input:focus { border-color: var(--purple, #88ce02); }
.af-field input::placeholder { color: var(--text-dim, #4a4a6e); }

.af-switch {
  text-align: center; margin-top: 16px;
  font-size: 12px; color: var(--text-muted, #7878a0);
}
.af-switch a {
  color: var(--purple-light, #c8fb50);
  cursor: pointer; text-decoration: none;
}
.af-switch a:hover { text-decoration: underline; }

/* ── Buttons ── */
.af-btn {
  display: block; width: 100%; padding: 12px 20px;
  border-radius: 14px;
  font-family: var(--font, system-ui, sans-serif);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  letter-spacing: 0.5px;
  transition: all 0.18s ease;
  margin-top: 8px;
}
.af-btn-primary {
  background: rgba(136, 206, 2, 0.2);
  color: var(--purple-light, #c8fb50); border-color: rgba(136,206,2,0.35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.af-btn-primary:hover {
  background: rgba(136, 206, 2, 0.35);
  box-shadow: 0 0 24px var(--purple-glow, rgba(136,206,2,0.30));
  transform: translateY(-1px);
}
.af-btn-accent {
  background: rgba(0, 229, 200, 0.15);
  color: var(--cyan, #00e5c8); border-color: rgba(0,229,200,0.3);
  font-weight: 700;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.af-btn-accent:hover {
  background: rgba(0, 229, 200, 0.28);
  box-shadow: 0 0 24px var(--cyan-glow, rgba(0,229,200,0.24));
  transform: translateY(-1px);
}
.af-btn-ghost {
  background: transparent;
  color: var(--text-muted, #7878a0);
  border-color: var(--border, #1c1c2e);
}
.af-btn-ghost:hover {
  border-color: rgba(136,206,2,0.25);
  color: var(--text-2, #b0b0c8);
  background: var(--purple-dim, rgba(136,206,2,0.06));
}
.af-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Paywall modal (aligned with landing: section card + eyebrow + CTA) ── */
.af-modal-paywall {
  text-align: center;
  max-width: 420px;
}
.af-paywall-eyebrow {
  display: inline-block;
  font-family: var(--font-heading, var(--font-sans, var(--af-font)));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--purple-light, var(--af-purple-light));
  margin-bottom: 12px;
  opacity: 0.95;
}
.af-modal-paywall .af-paywall-icon {
  font-size: 40px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px rgba(136,206,2,0.25));
}
.af-modal-paywall h2 {
  font-size: 22px;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  color: #f4f4ff;
}
.af-paywall-sub {
  font-size: 14px;
  color: var(--text-2, var(--af-text-2));
  margin-bottom: 24px;
  line-height: 1.6;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}
.af-modal-paywall .af-btn-primary {
  margin-top: 4px;
  padding: 12px 24px;
  border-radius: var(--radius-sm, 10px);
  font-weight: 700;
  box-shadow: 0 0 20px var(--purple-glow, var(--af-glow));
}
.af-modal-paywall .af-btn-ghost {
  margin-top: 10px;
  color: var(--text-muted, var(--af-muted));
  border-color: var(--border, var(--af-border));
}
.af-modal-paywall .af-btn-ghost:hover {
  color: var(--text-2, var(--af-text-2));
  border-color: rgba(136,206,2,0.25);
  background: var(--purple-dim, var(--af-purple-dim));
}
.af-paywall-icon {
  font-size: 42px;
  margin-bottom: 8px;
  color: var(--gold, #ffd54f);
}

/* ── Pricing modal ── */
.af-modal-pricing {
  width: 780px; max-width: 95vw;
  text-align: center;
}
.af-pricing-sub {
  font-size: 13px; color: var(--text-2, #b0b0c8);
  margin-bottom: 20px;
}
.af-referral-hint {
  background: var(--green-dim, rgba(105,255,180,0.08));
  border: 1px solid var(--green, #69ffb4);
  border-radius: 12px; padding: 8px 16px;
  font-size: 12px; color: var(--green, #69ffb4);
  margin-bottom: 20px;
}
.af-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.af-plan-card {
  background: rgba(17, 13, 32, 0.18);
  border: 1px solid var(--border, #1c1c2e);
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.af-plan-card:hover {
  border-color: var(--purple, #88ce02);
  transform: translateY(-2px);
}
.af-plan-best {
  border-color: var(--cyan, #00e5c8);
  box-shadow: 0 0 24px rgba(0,229,200,0.1);
}
.af-plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--cyan, #00e5c8);
  color: #08080b; font-size: 10px; font-weight: 700;
  padding: 2px 12px; border-radius: 8px;
  letter-spacing: 1px;
}
.af-plan-name {
  font-size: 14px; font-weight: 600;
  color: var(--text-2, #b0b0c8);
  margin-bottom: 8px;
}
.af-plan-price {
  font-size: 32px; font-weight: 700;
  color: var(--text, #ffffff);
}
.af-plan-price span { font-size: 14px; color: var(--text-muted, #7878a0); }
.af-plan-billing {
  font-size: 11px; color: var(--text-dim, #4a4a6e);
  margin-bottom: 14px;
}
.af-plan-features {
  list-style: none; padding: 0; margin: 0 0 16px;
  text-align: left;
}
.af-plan-features li {
  font-size: 12px; color: var(--text-2, #b0b0c8);
  padding: 4px 0; display: flex; align-items: center; gap: 6px;
}
.af-plan-features li::before {
  content: '\2713';
  color: var(--green, #69ffb4); font-weight: 700; font-size: 11px;
}

/* ── User menu ── */
.af-user-menu { position: relative; display: inline-flex; }
.af-user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 5px;
  background: rgba(17, 13, 32, 0.18);
  border: 1px solid var(--border, #1c1c2e);
  border-radius: 14px;
  cursor: pointer; transition: border-color 0.2s;
  font-family: var(--font, system-ui, sans-serif);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.af-user-pill:hover { border-color: var(--purple, #88ce02); }
.af-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple, #88ce02), var(--cyan, #00e5c8));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #000;
}
.af-user-name {
  font-size: 13px; color: var(--text, #ffffff);
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-sans, var(--font, 'PixelZH', system-ui, -apple-system, sans-serif));
}
.af-caret { font-size: 9px; color: var(--text-muted, #7878a0); }

.af-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 210px;
  background: rgba(17, 13, 32, 0.65);
  border: 1px solid var(--border, #1c1c2e);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  display: none; z-index: 9100;
}
.af-dropdown.open { display: block; }

.af-dd-info {
  padding: 8px 12px;
  font-size: 12px; color: var(--text-2, #b0b0c8);
  border-bottom: 1px solid var(--border, #1c1c2e);
  margin-bottom: 4px;
}
.af-dd-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px;
  margin-right: 4px;
}
.af-dd-badge.active { background: var(--purple, #88ce02); color: #000; }
.af-dd-badge.free { background: var(--border, #1c1c2e); color: var(--text-muted, #7878a0); }

.af-dd-item {
  display: block; width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-family: var(--font-sans, var(--font, system-ui, sans-serif));
  font-size: 12px;
  cursor: pointer; border: none;
  background: none; color: var(--text-2, #b0b0c8);
  text-align: left;
  transition: background 0.12s;
}
.af-dd-item:hover { background: var(--bg-2, #0d0d12); }
.af-dd-warn { color: #ff6a6a; }

/* ── Profile modal (landing page font) ── */
.af-modal-profile,
.af-modal-profile h2,
.af-modal-profile .af-profile-sub,
.af-modal-profile .af-field label,
.af-modal-profile .af-field input,
.af-modal-profile .af-btn,
.af-modal-profile .af-chip {
  font-family: var(--font-sans, var(--font, var(--af-font)));
}
.af-modal-profile h2 {
  font-family: var(--font-heading, var(--font-sans, var(--af-font)));
  font-size: 22px;
  letter-spacing: -0.3px;
  color: #f4f4ff;
}
.af-modal-profile .af-field label {
  font-family: var(--font-heading, var(--font-sans, var(--af-font)));
  letter-spacing: 2px;
}
.af-profile-sub {
  text-align: center;
  font-size: 14px;
  color: var(--text-2, var(--af-text-2));
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Toast ── */
.af-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9500;
  padding: 12px 22px;
  background: rgba(17, 13, 32, 0.65);
  border: 1px solid var(--border, #1c1c2e);
  border-radius: 14px;
  font-family: var(--font, system-ui, sans-serif);
  font-size: 13px;
  color: var(--text, #fff);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.af-toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.af-toast.success { border-color: var(--green, #c8fb50); }
.af-toast.error { border-color: #ff4a4a; }

/* ── OTP verification step ── */
.af-otp-info {
  background: rgba(136,206,2,0.08);
  border: 1px solid rgba(136,206,2,0.25);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2, #b0b0c8);
  margin-bottom: 16px;
  line-height: 1.5;
}
#af-reg-otp {
  letter-spacing: 8px;
  font-size: 24px;
  text-align: center;
  font-weight: 700;
}
.af-btn-wide { width: 100%; }

/* ── Responsive ── */
@media (max-width: 680px) {
  .af-plans { grid-template-columns: 1fr; }
  .af-modal-pricing { padding: 24px 16px; }
  .af-plan-badge { position: static; transform: none; margin-bottom: 8px; display: inline-block; }
}
@media (max-width: 440px) {
  .af-modal { padding: 24px 18px; }
}
