/* =========================
   RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "IRANSans", system-ui, sans-serif;
  direction: rtl;
  background: var(--bg-main);
  color: var(--text-main);
  transition: background 0.3s ease, color 0.3s ease;
}

/* =========================
   THEME VARIABLES
========================= */
:root {
  --bg-main: #eef4ff;
  --bg-card: rgba(255, 255, 255, 0.9);

  --text-main: #0f172a;
  --text-muted: #64748b;

  --border: #dbe2ef;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;

  --danger: #ef4444;
  --success: #22c55e;

  --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Dark Mode */
body.dark {
  --bg-main: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.9);

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;

  --border: #334155;

  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* =========================
   PAGE WRAPPER
========================= */
.auth-page {
  min-height: 100vh;
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* =========================
   BACKGROUND DECOR
========================= */
.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}

.shape-1 {
  width: 350px;
  height: 350px;
  background: rgba(14, 165, 233, 0.35);
  top: 60px;
  right: 60px;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: rgba(34, 197, 94, 0.35);
  bottom: 70px;
  left: 60px;
  animation-delay: 1.4s;
}

/* =========================
   CARD
========================= */
.auth-card {
  width: 100%;
  max-width: 1250px;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border-radius: 32px;
  box-shadow: var(--shadow-card);

  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
}

/* =========================
   LEFT SIDE
========================= */
.auth-left {
  background: linear-gradient(135deg, var(--primary), var(--success));
  padding: 50px;
  position: relative;
  display: flex;
  align-items: center;
}

.auth-left .content {
  z-index: 2;
  color: white;
}

.auth-left h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.auth-left p {
  font-size: 1rem;
  margin-bottom: 24px;
  opacity: 0.95;
}

.auth-left ul li {
  background: rgba(255, 255, 255, 0.18);
  padding: 12px 18px;
  margin-bottom: 12px;
  border-radius: 14px;
  font-size: 0.95rem;
}

/* =========================
   RIGHT SIDE (FORM)
========================= */
.auth-right {
  padding: 60px 50px;
}

.brand-box .badge {
  padding: 8px 16px;
  background: rgba(14, 165, 233, 0.15);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.brand-box h1 {
  margin: 16px 0 8px;
  font-size: 2rem;
  font-weight: 800;
}

.brand-box p {
  color: var(--text-muted);
  margin-bottom: 26px;
}

/* =========================
   THEME SWITCH
========================= */
.theme-switch {
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-start;
}

.theme-switch input {
  display: none;
}

.theme-switch label {
  width: 58px;
  height: 30px;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
}

.theme-switch label::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  top: 3px;
  right: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s ease;
}

.theme-switch input:checked + label {
  background: var(--primary);
}

.theme-switch input:checked + label::after {
  transform: translateX(-27px);
}

/* =========================
   FORM INPUTS (PREMIUM)
========================= */
.form-group {
  margin-bottom: 26px;
}

.input-container {
  position: relative;
}

.premium-input {
  width: 100%;
  padding: 18px;
  padding-right: 16px;
  padding-left: 48px;

  font-size: 1rem;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.premium-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
}

.premium-input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

/* Floating Label */
.premium-input:placeholder-shown + .premium-label {
  top: 50%;
  transform: translateY(-50%);
  right: 16px;
  font-size: 1rem;
  color: var(--text-muted);
}

.premium-input + .premium-label {
  position: absolute;
  background: var(--bg-card);
  padding: 0 6px;
  right: 16px;
  top: 0;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--primary);
  transition: all 0.2s ease;
  pointer-events: none;
}

/* Eye Button */
.eye-btn {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

/* =========================
   ERROR TEXT
========================= */
.error-text {
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.78rem;
}

/* =========================
   PASSWORD STRENGTH
========================= */
.strength-meter {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 8px;
}

.strength-meter .fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
}

/* =========================
   SUBMIT BUTTON
========================= */
.submit-btn {
  width: 100%;
  padding: 16px;
  margin-top: 10px;

  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 15px;

  color: #fff;
  font-size: 1rem;
  font-weight: 700;

  cursor: pointer;
  transition: 0.25s;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.4);
}

/* =========================
   RESPONSIVE
========================= */
/* برای تبلت‌ها و لپ‌تاپ‌های کوچک (تا ۱۰۲۴ پیکسل) */
@media (max-width: 1024px) {
  .auth-card {
    grid-template-columns: 1fr !important; /* اجبار به تک‌ستونه شدن */
    max-width: 500px; /* جلوگیری از کش آمدن بیش از حد */
    margin: 20px auto;
  }

  .auth-left {
    display: none !important; /* حذف بخش سمت چپ */
  }

  .auth-right {
    width: 100%;
  }
}

/* برای موبایل‌ها (تا ۶۰۰ پیکسل) */
@media (max-width: 600px) {
  .auth-page {
    padding: 20px 10px; /* کاهش پدینگ برای استفاده حداکثری از عرض */
    align-items: flex-start; /* شروع فرم از بالا */
  }

  .auth-right {
    padding: 24px 16px; /* کاهش پدینگ داخلی کارت */
  }

  /* اصلاح پدینگ اینپوت برای آیکون‌های احتمالی */
  .premium-input {
    padding: 14px 12px 14px 40px; 
  }

  .brand-box h1 {
    font-size: 1.4rem; /* کمی کوچک‌تر برای خوانایی بهتر */
  }
  
  /* اطمینان از اینکه دکمه‌ها و فیلدها عرض ۱۰۰٪ دارند */
  .submit-btn {
    padding: 12px;
  }
}

/* اضافه شده برای پوشش کامل سایزهای خیلی کوچک (زیر ۴۰۰ پیکسل) */
@media (max-width: 400px) {
  .auth-card {
    padding: 16px;
  }
  
  .brand-box {
    margin-bottom: 20px;
  }
}


/* =========================
   ANIMATIONS
========================= */
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
/* تنظیم کلی کانتینر سوییچ */
.theme-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  width: 100%;
}

.theme-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* استایل سوییچ ساده و مدرن */
.toggle-btn {
  width: 50px;
  height: 26px;
  background: #cbd5e1;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* دایره متحرک */
.toggle-btn::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 3px;
  right: 3px; /* حالت لایت */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* وضعیت فعال (دارک مود) */
#themeToggle:checked + .toggle-btn {
  background: var(--primary);
}

#themeToggle:checked + .toggle-btn::after {
  transform: translateX(-24px); /* جابجایی به سمت چپ */
}

/* مخفی کردن چک‌باکس */
#themeToggle {
  display: none;
}
/* =========================
   AUTH FOOTER (Ultra Clean)
========================= */

.auth-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.auth-footer span {
  margin-left: 6px;
}

.auth-link {
  position: relative;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

/* انیمیشن underline مدرن */
.auth-link::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  right: 0;
  bottom: -3px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.3s ease;
}

.auth-link:hover::after {
  width: 100%;
}

.auth-link:hover {
  color: var(--primary-dark);
}
/* --- 🌟 تایپوگرافی و خوانایی کلی --- */
body {
  font-size: 16px;
  line-height: 1.6;
}

.brand-box h1 {
  font-size: 2rem;
  font-weight: 700;
}

.brand-box p {
  font-size: 1.05rem;
  opacity: 0.85;
}

/* متن‌های توضیحی داخل فرم */
.form-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.form-subtitle {
  font-size: 1rem;
  opacity: 0.7;
  margin-bottom: 24px;
}

/* اینپوت‌ها کمی بزرگ‌تر و خوش‌خوان‌تر */
.premium-input {
  font-size: 1rem;
  padding: 16px 14px 16px 44px;
}

/* برچسب‌های شناور */
.floating-label {
  font-size: 0.95rem;
}

/* دکمه اصلی */
.submit-btn {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px;
}

/* فوتر پایین فرم */
.form-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
}

.form-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  position: relative;
}

.form-footer a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.form-footer a:hover::after {
  transform: scaleX(1);
}
