/* ══════════════════════════════════════════════════════════
   Auth Gate Modal — sign-up prompt for guest users
   ══════════════════════════════════════════════════════════ */

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .25s ease;
}
.auth-gate-overlay.visible { opacity: 1; }
.auth-gate-overlay.exiting {
  animation: agFadeOut .3s ease forwards;
}
@keyframes agFadeOut {
  to { opacity: 0; }
}

.auth-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-gate-card {
  position: relative;
  background: var(--surface, #111827);
  border: 1px solid var(--border, #1f2937);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: agSlideUp .35s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes agSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-gate-overlay.exiting .auth-gate-card {
  animation: agSlideDown .25s ease forwards;
}
@keyframes agSlideDown {
  to { opacity: 0; transform: translateY(20px) scale(.97); }
}

.auth-gate-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,.06);
  border: none; border-radius: 10px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted, #7b8ba5);
  cursor: pointer;
  transition: background .2s, color .2s;
  z-index: 2;
}
.auth-gate-close:hover { background: rgba(255,255,255,.1); color: var(--text, #f0f2f8); }

/* Hero */
.auth-gate-hero {
  text-align: center;
  padding: 36px 28px 24px;
  background: radial-gradient(ellipse at 30% 20%, rgba(196,113,237,.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(255,107,157,.1) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(124,156,255,.06) 0%, transparent 70%),
              linear-gradient(180deg, rgba(8,12,21,.3) 0%, transparent 100%);
  border-bottom: 1px solid rgba(196,113,237,.1);
}
.auth-gate-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
}
.auth-gate-title {
  font-size: 22px; font-weight: 800;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #ffb347, #ff6b9d, #c471ed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-gate-sub {
  font-size: 14px; color: var(--text-secondary, #c8d0e0);
  margin: 0; line-height: 1.5;
}

/* Body */
.auth-gate-body {
  padding: 24px 28px 20px;
}

/* Google button */
.auth-gate-google {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 20px;
  background: #fff;
  color: #333;
  border: none; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: box-shadow .2s, transform .15s;
}
.auth-gate-google:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  transform: translateY(-1px);
}

/* Divider */
.auth-gate-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
}
.auth-gate-divider-line {
  flex: 1; height: 1px;
  background: var(--border, #1f2937);
}
.auth-gate-divider-text {
  font-size: 12px; color: var(--text-secondary, #a0aec0);
  text-transform: uppercase; letter-spacing: .5px;
}

/* Email form */
.auth-gate-email-form {
  display: flex; flex-direction: column; gap: 10px;
}
.auth-gate-input {
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border, #1f2937);
  border-radius: 10px;
  color: var(--text, #f0f2f8);
  font-size: 16px; font-family: inherit; /* 16px prevents iOS Safari auto-zoom */
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.auth-gate-input:focus {
  border-color: #ff6b9d;
  box-shadow: 0 0 0 3px rgba(255,107,157,.12);
}
.auth-gate-input::placeholder { color: var(--text-secondary, #8a97ad); }

.auth-gate-email-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.auth-gate-email-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff6b9d, #c471ed);
  color: #fff; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: filter .2s, transform .15s;
}
.auth-gate-email-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.auth-gate-email-link {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border, #1f2937);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-secondary, #b0bcd0);
  font-size: 13px; cursor: pointer;
  font-family: inherit;
  transition: color .2s, background .2s, border-color .2s;
  text-align: center;
}
.auth-gate-email-link:hover {
  color: var(--text, #f0f2f8);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}

.auth-gate-error {
  font-size: 13px; color: #f87171;
  min-height: 18px; text-align: center;
}

/* Footer */
.auth-gate-footer {
  text-align: center;
  font-size: 12px; color: var(--text-secondary, #a0aec0);
  padding: 0 28px 20px;
  margin: 0;
  opacity: .85;
}

/* Mobile */
@media (max-width: 600px) {
  .auth-gate-overlay { padding: 0; align-items: flex-end; }
  .auth-gate-card {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 95dvh;
    overflow-y: auto;
  }
  .auth-gate-hero { padding: 28px 22px 20px; }
  .auth-gate-body { padding: 20px 22px 16px; }
}
