/* ===========================================================
   Rose VPN — Auth Page Styles
=========================================================== */
:root {
  --pink: #ff2d8d;
  --purple: #7b2fff;
  --blue: #4a7dff;
  --bg: #08070d;
  --surface: #13121d;
  --surface-2: #191726;
  --surface-3: #1e1c2e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f6f4fb;
  --text-dim: #b9b5cc;
  --text-faint: #8b87a0;
  --grad-brand: linear-gradient(95deg, var(--pink) 0%, var(--purple) 55%, var(--blue) 100%);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --green: #4ade80;
  --red: #ef4444;
  --amber: #f59e0b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

/* ===== Aurora ===== */
.aurora-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.3; will-change: transform; transform: translateZ(0); }
.a1 { width: 500px; height: 500px; background: radial-gradient(circle, var(--pink), transparent 70%); top: -15%; right: -10%; animation: drift1 22s ease-in-out infinite; }
.a2 { width: 550px; height: 550px; background: radial-gradient(circle, var(--blue), transparent 70%); bottom: -20%; left: -15%; animation: drift2 26s ease-in-out infinite; }
.a3 { width: 400px; height: 400px; background: radial-gradient(circle, var(--purple), transparent 70%); top: 40%; left: 35%; animation: drift3 30s ease-in-out infinite; opacity: 0.18; }
@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-50px,50px) scale(1.12)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(40px,-30px) scale(1.08)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(30px,30px) scale(0.9)} }

/* ===== Floating Particles ===== */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: float-up linear infinite;
}
.particle:nth-child(1) { left: 15%; animation-duration: 18s; animation-delay: 0s; }
.particle:nth-child(2) { left: 35%; animation-duration: 22s; animation-delay: 3s; width: 2px; height: 2px; }
.particle:nth-child(3) { left: 55%; animation-duration: 16s; animation-delay: 6s; }
.particle:nth-child(4) { left: 75%; animation-duration: 24s; animation-delay: 2s; width: 2px; height: 2px; }
.particle:nth-child(5) { left: 90%; animation-duration: 20s; animation-delay: 8s; }
@keyframes float-up {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ===== Auth Page Layout ===== */
.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 28px;
}

/* ===== Brand ===== */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.3s var(--ease);
}
.auth-brand:hover { transform: scale(1.04); }
.auth-brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; }
.brand-name { font-weight: 900; font-size: 1.5rem; letter-spacing: 0.3px; }
.accent { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===== Back to Site ===== */
.back-to-site {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 600;
  z-index: 5;
  transition: background 0.25s, color 0.25s, transform 0.25s, border-color 0.25s;
}
.back-to-site:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateX(3px);
}
.back-to-site svg { flex-shrink: 0; }

/* ===== Brand / Logo ===== */
.auth-logo {
  display: flex;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(255, 45, 141, 0.25);
  flex-shrink: 0;
}
.logo-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  display: block;
}
.logo-fallback { display: flex; }



/* ===== Auth Container ===== */
.auth-container { width: 100%; max-width: 440px; }

/* ===== Auth Card ===== */
.auth-card {
  width: 100%;
  animation: cardIn 0.5s var(--ease);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card-inner {
  background: rgba(19, 18, 29, 0.75);
  backdrop-filter: blur(32px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 36px 32px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* ===== Auth Header ===== */
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-header p { color: var(--text-dim); font-size: 0.9rem; }

/* ===== Form ===== */
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}
.label-row { display: flex; justify-content: space-between; align-items: center; }
.forgot-link {
  font-size: 0.78rem;
  color: var(--pink);
  font-weight: 500;
  transition: opacity 0.2s;
}
.forgot-link:hover { opacity: 0.8; }
.optional { font-weight: 400; color: var(--text-faint); font-size: 0.78rem; }

/* ===== Input with Icon ===== */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  right: 16px;
  color: var(--text-faint);
  pointer-events: none;
  z-index: 1;
  transition: color 0.25s;
}
.input-icon-wrap:focus-within .input-icon { color: var(--pink); }

.form-input {
  width: 100%;
  padding: 13px 46px 13px 46px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: rgba(8, 7, 13, 0.6);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.form-input::placeholder { color: var(--text-faint); opacity: 0.6; }
.form-input:hover { border-color: var(--line-strong); background: rgba(8, 7, 13, 0.8); }
.form-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 45, 141, 0.12), 0 0 20px rgba(255, 45, 141, 0.06);
  background: rgba(8, 7, 13, 0.9);
}
.form-input.error { border-color: var(--red); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }

.toggle-pass {
  position: absolute;
  left: 14px;
  color: var(--text-faint);
  transition: color 0.2s;
  display: flex;
  z-index: 1;
  padding: 4px;
}
.toggle-pass:hover { color: var(--text); }

/* ===== Password Strength ===== */
.pass-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  min-height: 18px;
}
.strength-bars { display: flex; gap: 4px; }
.strength-bars .bar {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.3s;
}
.strength-bars .bar.active-weak { background: var(--red); }
.strength-bars .bar.active-fair { background: var(--amber); }
.strength-bars .bar.active-good { background: var(--blue); }
.strength-bars .bar.active-strong { background: var(--green); }
.strength-label { font-size: 0.72rem; font-weight: 600; }

/* ===== Checkbox ===== */
.remember-row { flex-direction: row; }
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-dim);
  user-select: none;
}
.checkbox-wrap input { display: none; }
.checkmark {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.checkbox-wrap input:checked + .checkmark {
  background: var(--pink);
  border-color: var(--pink);
}
.checkbox-wrap input:checked + .checkmark::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.terms-link { color: var(--pink); font-weight: 600; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s, opacity 0.3s;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  border: none;
  position: relative;
}
.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 10px 30px rgba(255, 45, 141, 0.25), 0 4px 12px rgba(74, 125, 255, 0.18);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(255, 45, 141, 0.35), 0 6px 16px rgba(74, 125, 255, 0.25);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

.btn-loader { display: flex; align-items: center; }
.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  color: var(--pink);
  font-weight: 700;
  font-size: inherit;
  transition: opacity 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.link-btn:hover { opacity: 0.8; }

/* ===== Divider ===== */
.divider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.divider-line { flex: 1; height: 1px; background: var(--line); }
.divider-text { font-size: 0.78rem; color: var(--text-faint); font-weight: 500; }

/* ===== Auth Footer ===== */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* ===== Feature Pills ===== */
.auth-features {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.feature-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
}
.feature-pill svg { color: var(--text-faint); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
  flex-shrink: 0;
}
.toast-icon.success { background: rgba(74, 222, 128, 0.2); color: var(--green); }
.toast-icon.error { background: rgba(239, 68, 68, 0.2); color: var(--red); }

/* ===== Error Message ===== */
.field-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 2px;
  min-height: 0;
  overflow: hidden;
  transition: min-height 0.2s;
}

/* ===========================================================
   Responsive
=========================================================== */
@media (max-width: 500px) {
  .back-to-site {
    top: 16px;
    right: 16px;
    padding: 7px 14px;
    font-size: 0.76rem;
  }
  .auth-card-inner { padding: 32px 24px 28px; border-radius: 22px; }
  .auth-header h1 { font-size: 1.35rem; }
  .form-input { padding: 12px 40px 12px 40px; font-size: 0.88rem; }
  .auth-features { gap: 8px; }
  .feature-pill { padding: 6px 12px; font-size: 0.72rem; }
  .strength-bars .bar { width: 30px; }
}

@media (max-width: 360px) {
  .auth-page { padding: 24px 16px; }
  .auth-card-inner { padding: 28px 20px 24px; }
}
