/* =========================================================
   Register Page Styles (register.css)
   طراحی هماهنگ با تم کلی سایت بدون نیاز به style.css
   ========================================================= */

/* متغیرهای رنگی تم لایت و پایه */
:root,
[theme='light'] {
  --bg-color: #f4f6f9;
  --text-color: #1e1e2d;
  --card-bg: #ffffff;
  --navbar-bg: #661fff;
  --navbar-hover: #5815e3;
  --navbar-link-color: #ffffff;
  --menu-hover-bg: rgba(255, 255, 255, 0.15);
  --border-color: #e2e8f0;
  --accent-purple: #661fff;
  --hero-gradient: linear-gradient(145deg, #7a22ff 0%, #5300e8 100%);
  --subtext-color: #64748b;
  --item-border: #f1f5f9;
  --error-color: #e02424;
}

/* متغیرهای رنگی تم دارک */
[theme='dark'] {
  --bg-color: #121218;
  --text-color: #f1f1f1;
  --card-bg: #1e1e2a;
  --navbar-bg: #1e1538;
  --navbar-hover: #261b46;
  --navbar-link-color: #ffffff;
  --menu-hover-bg: rgba(255, 255, 255, 0.1);
  --border-color: #333346;
  --accent-purple: #8b5cf6;
  --hero-gradient: linear-gradient(145deg, #4f14b8 0%, #2f0676 100%);
  --subtext-color: #94a3b8;
  --item-border: #29293a;
  --error-color: #f87171;
}

/* ریست استایل‌ها و فونت */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', sans-serif;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* =================== کانتینر و کارت فرم ثبت نام =================== */
.auth-container {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 20px 70px 20px;
  width: 100%;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* عنوان صفحه */
.auth-title {
  color: var(--accent-purple);
  font-size: 2.1rem;
  font-weight: 900;
  margin-bottom: 35px;
  text-align: center;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ورودی‌های فرم */
.form-group {
  position: relative;
  width: 100%;
  display: block;
}

.form-input {
  width: 100%;
  height: 54px;
  padding: 12px 18px;
  font-size: 1rem;
  color: var(--text-color);
  background-color: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  display: block;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(102, 31, 255, 0.12);
}

/* استایل فیلد دارای خطا */
.form-input.input-error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(224, 36, 36, 0.12);
}

.form-input::placeholder {
  color: var(--subtext-color);
  font-size: 0.95rem;
}

/* پیام خطای اعتبارسنجی */
.error-message {
  display: block;
  width: 100%;
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 5px;
  margin-right: 5px;
  text-align: right;
  min-height: 1.2em;
}

/* گروه رمز عبور و دکمه چشم */
.password-group {
  position: relative;
  width: 100%;
  display: block;
}

.toggle-password {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  outline: none;
  z-index: 2;
}

.eye-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: invert(45%) sepia(10%) saturate(500%) hue-rotate(190deg);
  transition: filter 0.2s ease;
}

.toggle-password:hover .eye-icon {
  filter: invert(30%) sepia(85%) saturate(3000%) hue-rotate(250deg);
}

/* حالت راست‌چین (RTL) */
html[dir='rtl'] .password-group .form-input {
  padding-left: 45px;
}

html[dir='rtl'] .toggle-password {
  position: absolute;
  left: 14px;
  top: 14px;
}

/* حالت چپ‌چین (LTR) */
html[dir='ltr'] .password-group .form-input {
  padding-right: 45px;
}

html[dir='ltr'] .toggle-password {
  position: absolute;
  right: 14px;
  top: 14px;
}

/* دکمه ثبت نام کپسولی بنفش */
.auth-submit-btn {
  width: 100%;
  height: 52px;
  background-color: var(--accent-purple);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 15px;
  box-shadow: 0 4px 14px rgba(102, 31, 255, 0.25);
  transition:
    background-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.auth-submit-btn:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(102, 31, 255, 0.35);
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

/* بخش لینک رفتن به صفحه ورود */
.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  font-size: 1.05rem;
  color: var(--subtext-color);
}

.auth-switch-link {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 800;
  transition: opacity 0.2s ease;
}

.auth-switch-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* =================== فوتر صفحه =================== */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  text-align: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-text {
  font-size: 0.88rem;
  color: var(--subtext-color);
}

/* =================== ریسپانسیو =================== */
@media screen and (max-width: 600px) {
  .auth-container {
    padding: 35px 16px 50px 16px;
  }

  .auth-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
  }

  .form-input {
    height: 50px;
  }

  html[dir='rtl'] .toggle-password,
  html[dir='ltr'] .toggle-password {
    top: 12px;
  }

  .auth-submit-btn {
    height: 48px;
    font-size: 1.02rem;
  }

  .auth-switch {
    font-size: 0.95rem;
  }

  .error-message {
    font-size: 0.75rem;
  }
}
