/* ========== متغیرهای رنگ برای دارک/لایت مود ========== */
:root {
  --bg-body: #f8fafc;
  --hex-fill: #ffffff;
  --text-primary: #313131;
  --text-secondary: #4e4e4e;
  --label-color: #313131;
  --input-bg: #ffffff;
  --input-border: #e9ecef;
  --btn-next-bg: #ffbb00;
  --btn-next-hover: linear-gradient(105deg, #FFD633, #FFB347);
  --captcha-border: #e9ecef;
  --captcha-bg: #ffffff;
  --dropdown-bg: rgba(255, 255, 255, 0.9);
  --dropdown-border: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

body.dark {
  --bg-body: #1d1d1d;
  --hex-fill: #313131;
  --text-primary: #f1f5f9;
  --text-secondary: #cbcbcb;
  --label-color: #949494;
  --input-bg: #1d1d1d;
  --input-border: #4e4e4e;
  --btn-next-bg: #eab308;
  --btn-next-hover: linear-gradient(105deg, #fbbf24, #eab308);
  --captcha-border: #4e4e4e;
  --captcha-bg: #1e1e1e;
  --dropdown-bg: #1e1e1e;
  --dropdown-border: #333333;
  --shadow-color: rgba(0, 0, 0, 0.3);

  background-image: url(../img/login-bg-dark.png) !important;
}

/* استایل‌های اضافی که در فایل css اصلی وجود ندارند */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-image: url(../img/login-bg.png);
  background-repeat:  no-repeat;
  background-size: cover;
  background-color: var(--bg-body);
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'dynamicFont', 'Segoe UI', system-ui, sans-serif;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.2s ease;
}

.blur{
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

body.dark .blur{
  background: rgba(66, 66, 66, 0.5);
}

/* wrapper اصلی - شش ضلعی و فرم درون آن */
.hex-wrapper {
  position: relative;
  width: 780px;
  max-width: 94vw;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* SVG شش ضلعی - پس‌زمینه سفید و سایه */
.hex-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 -1px 1px rgba(255, 187, 0, 0.66));
  transition: all 0.2s ease;
}

.hex-svg path {
  fill: var(--hex-fill);
  transition: fill 0.3s ease;
}

/* فرم داخل شش‌ضلعی */
.form-inside {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  max-width: 340px;
  padding: 28px 20px 35px;
  text-align: center;
  z-index: 10;
  background: transparent;
  transition: all 0.2s;
}

/* لوگو و تایپوگرافی */
.logo-text {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  text-shadow: 2px 2px 0 rgba(255, 215, 0, 0.3);
  transition: color 0.3s ease;
}

h4 {
  font-size: 1.35rem;
  margin-bottom: 1.2rem !important;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

/* استایل فرم کنترل‌ها */
.form-control {
  border-radius: 14px;
  padding: 12px 18px;
  border: 2px solid var(--input-border);
  background-color: var(--input-bg);
  margin-bottom: 20px;
  font-size: 0.95rem;
  transition: all 0.2s;
  width: 100%;
  color: var(--text-primary);
}

.form-control:focus {
  border-color: #FFAA00;
  box-shadow: 0 0 0 4px rgba(255, 170, 0, 0.2);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

label {
  text-align: right;
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--label-color);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control {
  flex: 1;
}

.btn-outline-secondary {
  position: absolute;
  left: 5px;
  right: auto;
  background: transparent;
  border: none;
  z-index: 5;
  padding: 8px 12px;
  border-radius: 50%;
  cursor: pointer;
}

.btn-outline-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-login {
  background-color: var(--btn-next-bg);
  color: #1e2a1f;
  border: none;
  border-radius: 15px;
  padding: 12px 16px;
  font-size: 1.1rem;
  font-weight: 800;
  width: 100%;
  margin-top: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-login:hover {
  transform: translateY(-2px);
  background: var(--btn-next-hover);
  box-shadow: 0 12px 22px rgba(255, 160, 0, 0.35);
}

.btn-login:active {
  transform: translateY(1px);
}

/* کپچا استایل */
.captcha-container {
  margin-top: 10px;
  margin-bottom: 15px;
}

.captcha-box {
  border: 2px solid var(--captcha-border);
  background: var(--captcha-bg);
  border-radius: 12px;
  padding: 5px;
  text-align: center;
  transition: all 0.3s ease;
}

.captcha-box img {
  border-radius: 8px;
  height: 50px;
  width: auto;
}

.captcha-refresh {
  font-size: 1.5rem;
  cursor: pointer;
  color: #ffbb00;
  transition: transform 0.2s;
  display: inline-block;
}

.captcha-refresh:hover {
  transform: rotate(180deg);
  color: #ff9900;
}

.w-90 {
  width: 90%;
}

/* دکمه تغییر تم و زبان */
.theme-toggle,
.dropdown-toggle {
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-border);
  border-radius: 50px;
  padding: 8px 16px;
  margin: 5px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary);
}

.theme-toggle:hover,
.dropdown-toggle:hover {
  background: var(--input-bg);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.language-selector {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  gap: 10px;
  direction: ltr;
}

/* استایل مرحله دوم - مخفی در ابتدا */
.step-2-fields {
  display: none;
}

.step-1-fields {
  display: block;
}

/* انیمیشن تعویض مرحله */
.fade-transition {
  transition: opacity 0.3s ease;
}

.btn-next {
  background-color: var(--btn-next-bg);
  color: #1e2a1f;
  border: none;
  border-radius: 15px;
  padding: 12px 16px;
  font-size: 1.1rem;
  font-weight: 800;
  width: 100%;
  margin-top: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-next:hover {
  transform: translateY(-2px);
  background: var(--btn-next-hover);
  box-shadow: 0 12px 22px rgba(255, 160, 0, 0.35);
}

/* استایل پیام خطا */
.error-message {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: -15px;
  margin-bottom: 10px;
  text-align: right;
  display: none;
}

.error-message.show {
  display: block;
}

/* دکمه بازگشت */
.back-to-step1 {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 10px;
  cursor: pointer;
  transition: color 0.2s;
}

.back-to-step1:hover {
  color: #ffbb00;
}

/* استایل منوی کشویی دارک مود */
.dropdown-menu {
  background-color: var(--dropdown-bg);
  border-color: var(--dropdown-border);
}

.dropdown-item {
  color: var(--text-primary);
}

.dropdown-item:hover {
  background-color: var(--input-bg);
  color: #ffbb00;
}

/* تنظیمات ریسپانسیو */
@media (max-width: 650px) {
  body {
    padding: 16px;
  }

  .hex-wrapper {
    max-width: 96vw;
  }

  .form-inside {
    width: 80%;
    max-width: 290px;
    padding: 18px 16px 28px;
  }

  .logo-text {
    font-size: 1.9rem;
    margin-bottom: 6px;
  }

  .logo-text img {
    height: 100px !important;
  }

  h4 {
    font-size: 1.2rem;
    margin-bottom: 0.9rem !important;
  }

  .form-control {
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.85rem;
  }

  .btn-login,
  .btn-next {
    padding: 10px 14px;
    font-size: 1rem;
  }

  label {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .form-inside {
    width: 86%;
    max-width: 260px;
    padding: 14px 12px 22px;
  }

  .logo-text {
    font-size: 1.7rem;
  }

  h4 {
    font-size: 1rem;
  }

  .form-control {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .btn-login,
  .btn-next {
    padding: 9px 12px;
    font-size: 0.9rem;
  }
}