/* ==========================================
   Auth Pages — Login & Verify
   SurpriseLink v2.0
   ========================================== */

@import url("https://cdn.fontcdn.ir/Font/Persian/Vazirmatn/Vazirmatn.css");

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --border: rgba(139, 92, 246, 0.2);
  --border-hover: rgba(139, 92, 246, 0.5);
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --accent: #f472b6;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --error: #ef4444;
  --success: #10b981;
}

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

body {
  font-family: "Vazirmatn", sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Background blobs */
.auth-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.blob-1 {
  width: 400px; height: 400px;
  background: var(--primary);
  top: -100px; right: -100px;
  animation: blobMove 8s ease-in-out infinite;
}

.blob-2 {
  width: 300px; height: 300px;
  background: var(--accent);
  bottom: -80px; left: -80px;
  animation: blobMove 10s ease-in-out infinite reverse;
}

@keyframes blobMove {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.1) translate(20px, -20px); }
}

/* Container */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
  transition: opacity 0.2s;
}
.auth-logo:hover { opacity: 0.8; }
.auth-logo span:first-child { font-size: 1.8rem; }

/* Card */
.auth-card {
  width: 100%;
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.auth-card-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.auth-card-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.auth-card-header strong {
  color: var(--primary-light);
}

/* Alert */
.auth-alert {
  padding: 0.9rem 1.2rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: alertFadeIn 0.3s ease-out forwards;
}

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

.auth-alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Form */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Elegant Input */
.elegant-input-wrapper {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.elegant-input-wrapper:focus-within {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 0 20px rgba(139, 92, 246, 0.2);
}

.elegant-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.25rem 1rem;
  color: #fff;
  font-size: 1.25rem;
  font-family: inherit;
  letter-spacing: 2px;
  text-align: center;
  direction: ltr;
  outline: none;
  position: relative;
  z-index: 2;
  font-weight: 700;
}

.elegant-input::placeholder {
  color: rgba(255,255,255,0.15);
  letter-spacing: 2px;
  font-weight: 500;
}

.input-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.elegant-input-wrapper:focus-within .input-glow {
  opacity: 1;
}

.otp-input {
  letter-spacing: 0.5em !important;
  font-size: 1.5rem !important;
}

/* Button */
.btn-auth {
  width: 100%;
  padding: 0.95rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: 0.75rem;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s;
  box-shadow: 0 6px 24px rgba(139,92,246,0.35);
  margin-bottom: 1.2rem;
  position: relative;
  overflow: hidden;
}

.btn-auth::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.btn-auth:hover::before { left: 100%; }
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(139,92,246,0.5); }
.btn-auth:active { transform: translateY(0); }

.btn-auth .hidden { display: none; }

/* Divider */
.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  margin: 0.8rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.auth-divider::before { right: 0; }
.auth-divider::after { left: 0; }

/* Telegram Button */
.btn-telegram {
  width: 100%;
  padding: 0.85rem;
  background: rgba(0, 136, 204, 0.12);
  border: 1px solid rgba(0, 136, 204, 0.3);
  border-radius: 0.75rem;
  color: #67c8ff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.25s;
  margin-bottom: 1.2rem;
}

.btn-telegram:hover {
  background: rgba(0, 136, 204, 0.2);
  border-color: rgba(0, 136, 204, 0.5);
  transform: translateY(-2px);
}

/* Footer note */
.auth-footer-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-footer-note a { color: var(--primary-light); text-decoration: none; }
.auth-footer-note a:hover { color: var(--accent); }

/* Countdown */
.countdown-wrapper {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.countdown-num {
  color: var(--primary-light);
  font-weight: 700;
  font-size: 1rem;
}

/* Resend */
.resend-link {
  color: var(--primary-light);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.resend-link:hover { color: var(--accent); }

.text-muted { color: var(--text-muted); font-size: 0.88rem; }

/* Mobile */
@media (max-width: 480px) {
  .auth-card { padding: 1.8rem 1.5rem; }
}
