:root {
  --primary-color: #2ecc71;
  --secondary-color: #3498db;
  --bg-color: #ffffff;
  --text-color: #2c3e50;
  --input-bg: #f7f9fa;
  --border-radius: 1rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  direction: rtl;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.login-container {
  background-color: var(--bg-color);
  padding: 2rem;
  border-radius: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  z-index: 0;
}

.login-container h2 {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  font-size: 1.3rem;
}

.login-container input {
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  background-color: var(--input-bg);
  font-size: 1rem;
  transition: border 0.3s, box-shadow 0.3s;
  position: relative;
  z-index: 1;
}

.login-container input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.4);
  outline: none;
}

.login-container button {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.3s;
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
}

.login-container button:hover {
  transform: scale(1.03);
  opacity: 0.95;
}

.toggle {
  color: var(--secondary-color);
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.toggle:hover {
  text-decoration: underline;
}

.footer {
  font-size: 0.75rem;
  color: #95a5a6;
  position: relative;
  z-index: 1;
  line-height: 1.3;
}

.hidden {
  display: none;
}

/* موبایل - تا 480px */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .login-container {
    padding: 1.5rem;
    border-radius: 1.5rem;
    max-width: 100%;
    margin: 0 auto;
  }

  .login-container h2 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
  }

  .login-container input {
    padding: 0.7rem 0.8rem;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
  }

  .login-container button {
    padding: 0.8rem;
    font-size: 1rem;
  }

  .footer {
    font-size: 0.7rem;
  }

  .login-container::before {
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
  }
}

/* تبلت کوچک - 481px تا 768px */
@media (min-width: 481px) and (max-width: 768px) {
  .login-container {
    max-width: 420px;
    padding: 1.8rem;
  }

  .login-container h2 {
    font-size: 1.2rem;
  }
}

/* تبلت بزرگ و دسکتاپ - بالای 768px */
@media (min-width: 769px) {
  .login-container {
    max-width: 450px;
    padding: 2.5rem;
  }
}

/* تنظیمات برای گوشی‌های خیلی کوچک */
@media (max-width: 320px) {
  .login-container {
    padding: 1rem;
  }

  .login-container h2 {
    font-size: 1rem;
  }

  .login-container input {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  .login-container button {
    padding: 0.7rem;
    font-size: 0.9rem;
  }
}

/* تنظیمات برای landscape mode در موبایل */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 0.5rem;
  }

  .login-container {
    max-height: 95vh;
    padding: 1rem;
  }

  .login-container h2 {
    margin-bottom: 1rem;
    font-size: 1rem;
  }

  .login-container input {
    margin-bottom: 0.7rem;
    padding: 0.6rem;
  }

  .login-container button {
    padding: 0.7rem;
    margin-bottom: 0.7rem;
  }
}

/* استایل‌های جدید برای فراموشی رمز عبور */
.forgot-password-link {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
  margin-top: 10px;
  display: block;
  text-align: center;
  cursor: pointer;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

#forgot-password-form {
  margin-top: 20px;
}

#forgot-password-form input {
  margin-bottom: 15px;
}

.back-to-login {
  color: #6c757d;
  text-decoration: none;
  font-size: 14px;
  margin-top: 10px;
  display: block;
  text-align: center;
  cursor: pointer;
}

.back-to-login:hover {
  text-decoration: underline;
  color: #007bff;
}

.reset-password-form {
  margin-top: 20px;
}

.reset-password-form input {
  margin-bottom: 15px;
}

.password-strength {
  font-size: 12px;
  margin-top: 5px;
  padding: 5px;
  border-radius: 3px;
}

.password-weak {
  color: #dc3545;
  background-color: #f8d7da;
}

.password-medium {
  color: #fd7e14;
  background-color: #fff3cd;
}

.password-strong {
  color: #28a745;
  background-color: #d4edda;
}

.form-note {
  font-size: 13px;
  color: #6c757d;
  margin-top: 10px;
  text-align: center;
}
/* استایل‌های اضافی برای فرم‌های فراموشی رمز عبور */
#forgot-password-form,
#reset-password-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#forgot-password-form p,
#reset-password-form p {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0;
}

#forgot-identifier,
#reset-otp-code,
#new-password,
#confirm-password {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    text-align: right;
    direction: rtl;
}

#forgot-identifier:focus,
#reset-otp-code:focus,
#new-password:focus,
#confirm-password:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* انیمیشن برای تغییر فرم‌ها */
.login-container > div {
    transition: all 0.3s ease;
}

/* استایل خاص برای کد OTP */
#reset-otp-code {
    text-align: center;
    letter-spacing: 2px;
    font-family: monospace;
    font-size: 16px;
}
