/* ═══════════════════════════════════════════════════════════════
   QuerySafe Auth Pages — Dark AI Vibe
   ═══════════════════════════════════════════════════════════════ */

/* ── Base ───────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: #07070d;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

/* ── Animated gradient mesh background ──────────────────────── */
.auth-bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-bg-mesh::before {
  content: '';
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
  background:
    radial-gradient(ellipse 600px 600px at 20% 30%, rgba(113, 37, 190, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 70%, rgba(88, 28, 235, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 60% 20%, rgba(149, 77, 219, 0.08) 0%, transparent 70%);
  animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-30px, 20px) rotate(1deg); }
  100% { transform: translate(20px, -15px) rotate(-1deg); }
}

/* Grid overlay */
.auth-bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(113, 37, 190, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 37, 190, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
}

/* ── Glassmorphism Card ─────────────────────────────────────── */
.auth-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: cardFadeIn 0.6s ease-out;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Logo ───────────────────────────────────────────────────── */
.auth-logo {
  display: block;
  margin: 0 auto 1.5rem;
  width: 160px;
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(113, 37, 190, 0.3));
}

/* ── Typography ─────────────────────────────────────────────── */
.auth-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1.75rem;
  font-weight: 400;
}

/* ── Inputs ─────────────────────────────────────────────────── */
.auth-input-group {
  position: relative;
  margin-bottom: 1rem;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  color: #e8e8f0;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.30);
}

.auth-input:focus {
  border-color: rgba(113, 37, 190, 0.6);
  box-shadow: 0 0 0 3px rgba(113, 37, 190, 0.15), 0 0 20px rgba(113, 37, 190, 0.10);
  background: rgba(255, 255, 255, 0.08);
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e8e8f0;
  -webkit-box-shadow: 0 0 0 30px rgba(15, 15, 25, 0.95) inset;
  transition: background-color 5000s ease-in-out 0s;
  border-color: rgba(113, 37, 190, 0.4);
}

/* Password toggle */
.auth-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  transition: color 0.2s;
  z-index: 2;
}

.auth-pw-toggle:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ── Primary Button ─────────────────────────────────────────── */
.auth-btn {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, #7125be 0%, #954ddb 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.01em;
  margin-top: 0.5rem;
}

.auth-btn:hover {
  box-shadow: 0 6px 24px rgba(113, 37, 190, 0.35);
  transform: translateY(-1px);
}

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

/* ── Google Button ──────────────────────────────────────────── */
.auth-google-btn {
  width: 100%;
  padding: 0.7rem;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.auth-google-btn:hover {
  background: #f7f8f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  color: #3c4043;
  text-decoration: none;
}

.auth-google-btn svg {
  flex-shrink: 0;
}

/* ── Divider ────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
}

.auth-divider span {
  color: rgba(255, 255, 255, 0.30);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Links ──────────────────────────────────────────────────── */
.auth-link {
  color: rgba(255, 255, 255, 0.50);
  font-size: 0.875rem;
  text-align: center;
  display: block;
  margin-top: 1.25rem;
}

.auth-link a {
  color: #b47eff;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link a:hover {
  color: #d4aaff;
}

/* ── BETA badge ─────────────────────────────────────────────── */
.auth-beta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* ── Checkbox (dark theme) ──────────────────────────────────── */
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0.75rem 0 0.25rem;
}

.auth-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #7125be;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-check label {
  color: rgba(255, 255, 255, 0.50);
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.auth-check label a {
  color: #b47eff;
  text-decoration: none;
  font-weight: 500;
}

.auth-check label a:hover {
  color: #d4aaff;
}

/* ── Password hint ──────────────────────────────────────────── */
.auth-pw-hint {
  color: rgba(255, 255, 255, 0.30);
  font-size: 0.75rem;
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  padding: 1.5rem 0;
  color: rgba(255, 255, 255, 0.20);
  font-size: 0.75rem;
  position: relative;
  z-index: 1;
}

.auth-footer a {
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  color: rgba(255, 255, 255, 0.55);
}

.auth-footer .heart-icon {
  color: #e53935;
  font-size: 0.85rem;
  vertical-align: middle;
}

/* ── Alert / Error box ──────────────────────────────────────── */
.auth-alert {
  padding: 0.65rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: alertSlide 0.3s ease-out;
}

.auth-alert-error {
  background: rgba(245, 54, 92, 0.15);
  border: 1px solid rgba(245, 54, 92, 0.25);
  color: #ff7b93;
}

.auth-alert-success {
  background: rgba(45, 206, 137, 0.15);
  border: 1px solid rgba(45, 206, 137, 0.25);
  color: #6aeaac;
}

.auth-alert-info {
  background: rgba(17, 205, 239, 0.15);
  border: 1px solid rgba(17, 205, 239, 0.25);
  color: #5dd9ef;
}

.auth-alert-warning {
  background: rgba(251, 140, 0, 0.15);
  border: 1px solid rgba(251, 140, 0, 0.25);
  color: #ffb84d;
}

.auth-alert .close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 2px;
  line-height: 1;
  transition: opacity 0.2s;
}

.auth-alert .close-btn:hover {
  opacity: 1;
}

@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── OTP-specific ───────────────────────────────────────────── */
.auth-otp-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  font-weight: 600;
}

.auth-resend-link {
  color: #b47eff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.auth-resend-link:hover {
  color: #d4aaff;
}

.auth-resend-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.auth-timer {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 576px) {
  .auth-card {
    padding: 2rem 1.25rem;
    margin: 0 1rem;
    border-radius: 16px;
  }

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

  .auth-logo {
    width: 130px;
  }
}

/* ── Toast improvements (auth pages) ────────────────────────── */
.auth-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-toast {
  min-width: 300px;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastSlideIn 0.3s ease-out;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.auth-toast-success {
  background: rgba(45, 206, 137, 0.95);
  color: #fff;
}

.auth-toast-error {
  background: rgba(245, 54, 92, 0.95);
  color: #fff;
}

.auth-toast-warning {
  background: rgba(251, 140, 0, 0.95);
  color: #fff;
}

.auth-toast .toast-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.2s;
  flex-shrink: 0;
}

.auth-toast .toast-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}
