/* =========================================================
   AUTH PAGES — LOGIN / REGISTER
   Namespace: .auth-*
   تم: روشن‌تر (Ivory + Olive + Terracotta)
   ========================================================= */

:root {
  --sy-olive: #24372F;
  --sy-olive-2: #2C443A;
  --sy-olive-dark: #18251F;
  --sy-olive-deep: #1A2822;
  --sy-ivory: #FAF8F3;
  --sy-ivory-dark: #F8F5EF;
  --sy-sand: #F2EDE4;
  --sy-sand-dark: #EDE7DC;
  --sy-ink: #171A18;
  --sy-muted: #5f645c;
  --sy-muted-light: #737869;
  --sy-muted-lighter: #8a8f83;
  --sy-terra: #B85C38;
  --sy-terra-dark: #A44E2E;
  --sy-terra-darker: #9A4B2C;
  --sy-lime: #D9E84A;
  --sy-lime-soft: rgba(217, 232, 74, 0.15);
  --sy-lime-softer: rgba(217, 232, 74, 0.12);
  --sy-white: #FFFFFF;
  --sy-border: #E8E2D8;
  --sy-border-dark: rgba(36, 55, 47, 0.08);
  --sy-border-light: #F0EDE6;
  --sy-font: 'Vazirmatn', Tahoma, sans-serif;
  --sy-font-display: 'Lalezar', 'Vazirmatn', Tahoma, sans-serif;
  --sy-font-mono: 'Vazirmatn', Tahoma, sans-serif;
  --sy-ease: cubic-bezier(0.32, 0.72, 0.24, 1);
  --sy-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sy-t-fast: 220ms;
  --sy-t-base: 380ms;
  --sy-t-slow: 700ms;
  --sy-container-max: 1320px;
  --sy-container-pad: 32px;
  --sy-radius-xs: 3px;
  --sy-radius-sm: 6px;
  --sy-radius-md: 10px;
  --sy-radius-lg: 16px;
}

/* ═══════════ BASE ═══════════ */
.auth-page {
  font-family: var(--sy-font);
  background: var(--sy-ivory);
  color: var(--sy-ink);
  direction: rtl;
  min-height: 100vh;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
  box-sizing: border-box;
}

.auth-page a {
  text-decoration: none;
  color: inherit;
}

.auth-page button {
  font-family: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

/* ═══════════ BACKGROUND ═══════════ */
.auth-section {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--sy-border-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--sy-border-dark) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.4;
}

.auth-bg__accent {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
}

.auth-bg__accent--1 {
  width: 600px;
  height: 600px;
  background: var(--sy-olive);
  top: -200px;
  right: -200px;
}

.auth-bg__accent--2 {
  width: 400px;
  height: 400px;
  background: var(--sy-terra);
  bottom: -150px;
  left: -150px;
  opacity: 0.05;
}

/* ═══════════ CONTAINER ═══════════ */
.auth-container {
  max-width: var(--sy-container-max);
  margin: 0 auto;
  padding: 0 var(--sy-container-pad);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════ LAYOUT ═══════════ */
.auth-layout {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  max-width: 1100px;
  width: 100%;
  background: var(--sy-white);
  border-radius: var(--sy-radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(23, 26, 24, 0.12);
}

.auth-layout--register {
  max-width: 1200px;
}

/* ═══════════ BRAND PANEL ═══════════ */
.auth-brand-panel {
  background: var(--sy-olive);
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 241, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 232, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.auth-brand__icon {
  width: 48px;
  height: 48px;
}

.auth-brand__icon svg {
  width: 100%;
  height: 100%;
}

.auth-brand__name {
  font-family: var(--sy-font-display);
  font-size: 24px;
  color: var(--sy-white);
}

.auth-brand__content {
  position: relative;
  z-index: 1;
}

.auth-brand__code {
  display: inline-block;
  font-family: var(--sy-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sy-lime);
  margin-bottom: 16px;
}

.auth-brand__title {
  font-family: var(--sy-font-display);
  font-size: 32px;
  color: var(--sy-white);
  margin: 0 0 16px;
  line-height: 1.2;
}

.auth-brand__desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(245, 241, 232, 0.75);
  margin: 0;
}

.auth-brand__features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.auth-brand__feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.85);
}

.auth-brand__feature i {
  color: var(--sy-lime);
  font-size: 14px;
}

/* ═══════════ FORM PANEL ═══════════ */
.auth-form-panel {
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 420px;
}

.auth-form-wrapper--register {
  max-width: 480px;
}

.auth-form-header {
  margin-bottom: 32px;
}

.auth-form-header__code {
  display: inline-block;
  font-family: var(--sy-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sy-terra);
  margin-bottom: 12px;
}

.auth-form-header__title {
  font-family: var(--sy-font-display);
  font-size: 32px;
  color: var(--sy-ink);
  margin: 0 0 8px;
}

.auth-form-header__desc {
  font-size: 14px;
  color: var(--sy-muted);
  margin: 0;
}

/* ═══════════ FORM ═══════════ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sy-ink);
}

.auth-form__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-form__input-icon {
  position: absolute;
  right: 16px;
  color: var(--sy-muted-light);
  font-size: 14px;
  pointer-events: none;
}

.auth-form__input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border: 1.5px solid var(--sy-border);
  border-radius: var(--sy-radius-sm);
  font-size: 14px;
  color: var(--sy-ink);
  background: var(--sy-white);
  transition: all var(--sy-t-fast);
}

.auth-form__input:focus {
  outline: none;
  border-color: var(--sy-terra);
  box-shadow: 0 0 0 4px rgba(184, 92, 56, 0.1);
}

.auth-form__input::placeholder {
  color: var(--sy-muted-light);
}

.auth-form__toggle-pass {
  position: absolute;
  left: 16px;
  color: var(--sy-muted-light);
  font-size: 14px;
  transition: color var(--sy-t-fast);
}

.auth-form__toggle-pass:hover {
  color: var(--sy-terra);
}

/* Checkbox */
.auth-form__checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--sy-muted);
}

.auth-form__checkbox input {
  display: none;
}

.auth-form__checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--sy-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--sy-t-fast);
  flex-shrink: 0;
}

.auth-form__checkbox input:checked + .auth-form__checkbox-box {
  background: var(--sy-olive);
  border-color: var(--sy-olive);
}

.auth-form__checkbox input:checked + .auth-form__checkbox-box::after {
  content: '✓';
  color: var(--sy-lime);
  font-size: 12px;
  font-weight: 700;
}

.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-form__forgot {
  font-size: 13px;
  color: var(--sy-terra);
  transition: color var(--sy-t-fast);
}

.auth-form__forgot:hover {
  color: var(--sy-terra-dark);
}

/* Submit */
.auth-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: var(--sy-olive);
  color: var(--sy-white);
  border-radius: var(--sy-radius-sm);
  font-size: 15px;
  font-weight: 700;
  transition: all var(--sy-t-fast);
}

.auth-form__submit:hover {
  background: var(--sy-olive-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(36, 55, 47, 0.25);
}

/* Divider */
.auth-form__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-form__divider::before,
.auth-form__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sy-border);
}

.auth-form__divider span {
  font-size: 12px;
  color: var(--sy-muted-light);
}

/* Social */
.auth-form__social {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.auth-form__social-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--sy-border);
  border-radius: var(--sy-radius-sm);
  font-size: 18px;
  color: var(--sy-muted);
  transition: all var(--sy-t-fast);
}

.auth-form__social-btn:hover {
  border-color: var(--sy-olive);
  color: var(--sy-olive);
  background: var(--sy-sand);
}

/* Switch */
.auth-form__switch {
  text-align: center;
  font-size: 14px;
  color: var(--sy-muted);
  margin-top: 24px;
}

.auth-form__switch-link {
  color: var(--sy-terra);
  font-weight: 600;
  transition: color var(--sy-t-fast);
}

.auth-form__switch-link:hover {
  color: var(--sy-terra-dark);
}

/* ═══════════ ACCOUNT TYPE SELECTOR ═══════════ */
.auth-form__type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.auth-form__type-option input {
  display: none;
}

.auth-form__type-option-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1.5px solid var(--sy-border);
  border-radius: var(--sy-radius-sm);
  cursor: pointer;
  transition: all var(--sy-t-fast);
}

.auth-form__type-option-box i {
  font-size: 20px;
  color: var(--sy-muted);
  transition: color var(--sy-t-fast);
}

.auth-form__type-option-box span {
  font-size: 12px;
  font-weight: 600;
  color: var(--sy-muted);
  transition: color var(--sy-t-fast);
}

.auth-form__type-option input:checked + .auth-form__type-option-box {
  border-color: var(--sy-olive);
  background: var(--sy-lime-soft);
}

.auth-form__type-option input:checked + .auth-form__type-option-box i {
  color: var(--sy-olive);
}

.auth-form__type-option input:checked + .auth-form__type-option-box span {
  color: var(--sy-olive);
}

/* Password Strength */
.auth-form__password-strength {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form__password-bar {
  height: 4px;
  background: var(--sy-border);
  border-radius: 2px;
  overflow: hidden;
}

.auth-form__password-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--sy-terra);
  border-radius: 2px;
  transition: all var(--sy-t-base);
}

.auth-form__password-bar-fill.weak { width: 33%; background: var(--sy-terra); }
.auth-form__password-bar-fill.medium { width: 66%; background: var(--sy-lime); }
.auth-form__password-bar-fill.strong { width: 100%; background: var(--sy-olive); }

.auth-form__password-hint {
  font-size: 12px;
  color: var(--sy-muted-light);
}

.auth-form__link {
  color: var(--sy-terra);
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 991px) {
  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .auth-brand-panel {
    padding: 32px;
  }

  .auth-brand__features {
    display: none;
  }

  .auth-form-panel {
    padding: 32px;
  }
}

@media (max-width: 575px) {
  .auth-container {
    padding: 0 16px;
  }

  .auth-layout {
    border-radius: var(--sy-radius-md);
  }

  .auth-brand-panel {
    padding: 24px;
  }

  .auth-brand__title {
    font-size: 26px;
  }

  .auth-form-panel {
    padding: 24px;
  }

  .auth-form-header__title {
    font-size: 26px;
  }
}

/* ═══════════ REDUCED MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════ ACCESSIBILITY ═══════════ */
.auth-page :focus-visible {
  outline: 2px solid var(--sy-terra);
  outline-offset: 3px;
}

.auth-page :focus:not(:focus-visible) {
  outline: none;
}

/* ── Validation feedback (ورود / ثبت‌نام) ── */
.auth-form__alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1.5px solid rgba(184, 60, 56, 0.35);
  border-radius: var(--sy-radius-sm);
  background: #fdecea;
  color: #8a2a24;
  font-size: 13.5px;
  line-height: 1.8;
}

.auth-form__alert > i {
  flex-shrink: 0;
  margin-top: 4px;
  font-size: 16px;
}

.auth-form__alert-body p {
  margin: 0;
  font-weight: 600;
}

.auth-form__alert-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--sy-terra-darker);
  font-weight: 700;
  text-decoration: underline;
}

.auth-form__input.is-invalid {
  border-color: #b83c38;
  background: #fffafa;
}

.auth-form__input.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(184, 60, 56, 0.12);
}
