
/* ==========================================================
   ZABANDAN AUTH V2
   Minimal / Neutral / Indigo
   ========================================================== */

:root {
  --auth-bg: #f7f8fb;
  --auth-card: #ffffff;

  --auth-text: #1d2433;
  --auth-text-soft: #737b8c;
  --auth-text-faint: #9aa1ad;

  --auth-border: #e6e9ef;
  --auth-border-hover: #d6dae3;

  --auth-primary: #625bf6;
  --auth-primary-hover: #5149e8;
  --auth-primary-soft: #f0efff;

  --auth-danger: #d84a4a;
  --auth-success: #27875d;

  --auth-radius: 24px;
  --auth-input-radius: 13px;

  --auth-shadow:
    0 24px 70px rgba(29, 36, 51, 0.07);
}


/* ===========================
   BASE
   =========================== */

* {
  box-sizing: border-box;
}

html {
  background: var(--auth-bg) !important;
}

body {
  margin: 0 !important;

  min-height: 100vh !important;
  min-height: 100dvh !important;

  direction: rtl !important;

  background: var(--auth-bg) !important;
  color: var(--auth-text) !important;

  font-family:
    Vazir,
    Vazirmatn,
    Tahoma,
    Arial,
    sans-serif !important;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* ===========================
   PAGE
   =========================== */

.auth-shell {
  width: min(1120px, calc(100% - 48px)) !important;

  min-height: calc(100dvh - 64px) !important;

  margin: 32px auto !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 470px !important;

  direction: ltr !important;

  background: #fff !important;

  border: 1px solid var(--auth-border) !important;
  border-radius: 28px !important;

  overflow: hidden !important;

  box-shadow: var(--auth-shadow) !important;
}


/* ===========================
   LEFT / BRAND AREA
   =========================== */

.story-panel {
  position: relative !important;

  direction: rtl !important;

  padding: 48px !important;

  border: 0 !important;
  border-radius: 0 !important;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(98, 91, 246, 0.07),
      transparent 260px
    ),
    #fafaff !important;

  box-shadow: none !important;

  overflow: hidden !important;

  display: flex !important;
  flex-direction: column !important;
}


/* very subtle visual element */

.story-panel::before {
  content: "";

  position: absolute;

  width: 330px;
  height: 330px;

  left: -160px;
  bottom: -160px;

  border: 1px solid rgba(98, 91, 246, .12);
  border-radius: 50%;

  pointer-events: none;
}

.story-panel::after {
  content: "";

  position: absolute;

  width: 190px;
  height: 190px;

  left: -80px;
  bottom: -80px;

  border: 1px solid rgba(98, 91, 246, .12);
  border-radius: 50%;

  pointer-events: none;
}


/* ===========================
   BRAND
   =========================== */

.brand-row {
  position: relative;
  z-index: 2;

  margin: 0 0 70px !important;
}

.brand {
  display: inline-flex !important;

  align-items: center !important;
  gap: 13px !important;

  color: var(--auth-text) !important;
  text-decoration: none !important;
}

.brand-mark {
  width: 54px !important;
  height: 54px !important;

  flex: 0 0 54px !important;

  display: grid !important;
  place-items: center !important;

  padding: 7px !important;

  background: #fff !important;

  border: 1px solid var(--auth-border) !important;
  border-radius: 16px !important;

  box-shadow:
    0 7px 25px rgba(29, 36, 51, .06) !important;

  overflow: hidden !important;
}

.brand-mark img,
.auth-logo {
  display: block !important;

  width: 100% !important;
  height: 100% !important;

  object-fit: contain !important;
}

.brand-copy {
  display: flex !important;
  flex-direction: column !important;
}

.brand-copy strong {
  color: var(--auth-text) !important;

  font-size: 18px !important;
  font-weight: 900 !important;

  line-height: 1.5 !important;
}

.brand-copy small {
  color: var(--auth-text-faint) !important;

  font-size: 10px !important;
  font-weight: 700 !important;

  letter-spacing: 1.2px !important;
}


/* ===========================
   STORY CONTENT
   =========================== */

.story-panel h1,
.story-panel h2 {
  position: relative;
  z-index: 2;

  max-width: 470px !important;

  margin: 0 0 18px !important;

  color: var(--auth-text) !important;

  font-size: clamp(29px, 3vw, 40px) !important;
  font-weight: 900 !important;

  line-height: 1.65 !important;

  letter-spacing: -.5px !important;
}

.story-panel h1::after,
.story-panel h2::after {
  content: "";

  display: block;

  width: 46px;
  height: 4px;

  margin-top: 20px;

  border-radius: 999px;

  background: var(--auth-primary);
}

.story-panel p {
  position: relative;
  z-index: 2;

  max-width: 500px !important;

  margin: 0 !important;

  color: var(--auth-text-soft) !important;

  font-size: 14px !important;
  font-weight: 400 !important;

  line-height: 2.05 !important;
}


/* remove old busy feature boxes */

.feature-strip {
  display: none !important;
}


/* ===========================
   FORM SIDE
   =========================== */

.form-panel {
  direction: rtl !important;

  padding: 52px 44px !important;

  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  background: #fff !important;

  border: 0 !important;
  border-right: 1px solid var(--auth-border) !important;

  border-radius: 0 !important;
  box-shadow: none !important;
}

.form-wrap {
  width: 100% !important;
  max-width: 370px !important;

  margin: 0 auto !important;
}


/* ===========================
   MOBILE BRAND
   =========================== */

.mobile-brand {
  display: none !important;
}


/* ===========================
   HEADING
   =========================== */

.form-heading {
  margin: 0 0 30px !important;
}

.form-kicker {
  display: inline-flex !important;

  align-items: center !important;

  min-height: 28px !important;

  margin: 0 0 12px !important;
  padding: 0 10px !important;

  background: var(--auth-primary-soft) !important;
  color: var(--auth-primary) !important;

  border: 0 !important;
  border-radius: 8px !important;

  font-size: 11px !important;
  font-weight: 800 !important;
}

.form-heading h1,
.form-heading h2 {
  margin: 0 0 9px !important;

  color: var(--auth-text) !important;

  font-size: 28px !important;
  font-weight: 900 !important;

  line-height: 1.55 !important;

  letter-spacing: -.3px !important;
}

.form-heading p {
  margin: 0 !important;

  color: var(--auth-text-soft) !important;

  font-size: 13px !important;
  font-weight: 400 !important;

  line-height: 1.9 !important;
}


/* ===========================
   TABS
   =========================== */

.auth-tabs {
  width: 100% !important;

  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;

  gap: 4px !important;

  padding: 4px !important;
  margin: 0 0 24px !important;

  background: #f5f6f8 !important;

  border: 1px solid #f0f1f4 !important;
  border-radius: 12px !important;
}

.auth-tab {
  min-height: 40px !important;

  border: 0 !important;
  border-radius: 9px !important;

  background: transparent !important;

  color: var(--auth-text-soft) !important;

  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;

  cursor: pointer !important;
}

.auth-tab.active,
.auth-tab[aria-selected="true"] {
  background: #fff !important;

  color: var(--auth-text) !important;

  box-shadow:
    0 2px 9px rgba(29, 36, 51, .07) !important;
}


/* ===========================
   FORM
   =========================== */

.form {
  width: 100% !important;
}

.form-group,
.field,
.input-wrap,
.input-group {
  position: relative !important;
}

.form label {
  display: block !important;

  margin: 0 0 7px !important;

  color: #353b48 !important;

  font-size: 12px !important;
  font-weight: 700 !important;

  line-height: 1.7 !important;
}


/* ===========================
   INPUTS
   =========================== */

.form input,
.form select,
.form textarea,
.field input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"] {
  width: 100% !important;
  min-height: 52px !important;

  padding: 0 15px !important;

  background: #fff !important;
  color: var(--auth-text) !important;

  border: 1px solid var(--auth-border) !important;
  border-radius: var(--auth-input-radius) !important;

  outline: 0 !important;

  box-shadow: none !important;

  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;

  transition:
    border-color .16s ease,
    box-shadow .16s ease,
    background-color .16s ease !important;
}

.form input::placeholder,
input::placeholder {
  color: #a5abb6 !important;
  opacity: 1 !important;
}

.form input:hover,
.field input:hover {
  border-color: var(--auth-border-hover) !important;
}

.form input:focus,
.field input:focus,
input:focus {
  border-color: var(--auth-primary) !important;

  box-shadow:
    0 0 0 4px rgba(98, 91, 246, .09) !important;
}


/* OTP */

.otp-input,
input[autocomplete="one-time-code"] {
  text-align: center !important;

  letter-spacing: 5px !important;

  font-size: 18px !important;
  font-weight: 800 !important;
}


/* ===========================
   PASSWORD TOGGLE
   =========================== */

.password-toggle {
  color: #9299a6 !important;

  border: 0 !important;
  border-radius: 8px !important;

  background: transparent !important;
}

.password-toggle:hover {
  color: var(--auth-text) !important;

  background: #f5f6f8 !important;
}


/* ===========================
   PRIMARY BUTTON
   =========================== */

.submit-btn,
.form button[type="submit"],
#loginForm button[type="submit"],
#registerForm button[type="submit"] {
  width: 100% !important;
  min-height: 52px !important;

  margin-top: 10px !important;

  border: 1px solid var(--auth-primary) !important;
  border-radius: 13px !important;

  background: var(--auth-primary) !important;
  color: #fff !important;

  box-shadow:
    0 8px 18px rgba(98, 91, 246, .18) !important;

  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 800 !important;

  cursor: pointer !important;

  transition:
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease !important;
}

.submit-btn:hover,
.form button[type="submit"]:hover {
  background: var(--auth-primary-hover) !important;
  border-color: var(--auth-primary-hover) !important;

  transform: translateY(-1px) !important;

  box-shadow:
    0 11px 22px rgba(98, 91, 246, .23) !important;
}

.submit-btn:active,
.form button[type="submit"]:active {
  transform: translateY(0) !important;
}

.submit-btn:disabled,
.form button[type="submit"]:disabled {
  opacity: .5 !important;

  cursor: not-allowed !important;

  transform: none !important;
  box-shadow: none !important;
}


/* ===========================
   LINKS
   =========================== */

.form a,
.switch-link,
.forgot-link {
  color: var(--auth-primary) !important;

  font-weight: 700 !important;

  text-decoration: none !important;
}

.form a:hover,
.switch-link:hover,
.forgot-link:hover {
  color: var(--auth-primary-hover) !important;

  text-decoration: none !important;
}


/* ===========================
   STATUS MESSAGES
   =========================== */

.form-message,
.alert,
.error-message,
.success-message {
  padding: 10px 12px !important;

  border-radius: 10px !important;

  font-size: 12px !important;
  line-height: 1.8 !important;
}

.error-message,
.alert.error,
.form-message.error {
  background: #fff5f5 !important;
  color: #b33f3f !important;

  border: 1px solid #f5dddd !important;
}

.success-message,
.alert.success,
.form-message.success {
  background: #f2faf6 !important;
  color: #247653 !important;

  border: 1px solid #d9eee3 !important;
}


/* ===========================
   SMALL DETAILS
   =========================== */

.form hr {
  border: 0 !important;
  border-top: 1px solid var(--auth-border) !important;
}

::selection {
  background: rgba(98, 91, 246, .18);
  color: var(--auth-text);
}


/* ===========================
   TABLET
   =========================== */

@media (max-width: 900px) {

  .auth-shell {
    width: min(860px, calc(100% - 28px)) !important;

    min-height: calc(100dvh - 36px) !important;

    margin: 18px auto !important;

    grid-template-columns: minmax(0, 1fr) 430px !important;
  }

  .story-panel {
    padding: 34px !important;
  }

  .story-panel h1,
  .story-panel h2 {
    font-size: 30px !important;
  }

  .form-panel {
    padding: 42px 32px !important;
  }

}


/* ===========================
   MOBILE
   =========================== */

@media (max-width: 720px) {

  html,
  body {
    background: #fff !important;
  }

  .auth-shell {
    display: block !important;

    width: 100% !important;

    min-height: 100vh !important;
    min-height: 100dvh !important;

    margin: 0 !important;

    background: #fff !important;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;
  }

  .story-panel {
    display: none !important;
  }

  .form-panel {
    width: 100% !important;

    min-height: 100vh !important;
    min-height: 100dvh !important;

    padding:
      max(28px, env(safe-area-inset-top))
      22px
      max(30px, env(safe-area-inset-bottom)) !important;

    border: 0 !important;

    display: flex !important;
    align-items: center !important;
  }

  .form-wrap {
    width: 100% !important;
    max-width: 400px !important;
  }

  .mobile-brand {
    display: flex !important;

    width: max-content !important;

    align-items: center !important;
    justify-content: center !important;

    margin: 0 auto 32px !important;

    color: var(--auth-text) !important;
    text-decoration: none !important;
  }

  .mobile-brand .brand-mark {
    width: 56px !important;
    height: 56px !important;

    flex-basis: 56px !important;
  }

  .form-heading {
    text-align: right !important;

    margin-bottom: 27px !important;
  }

  .form-heading h1,
  .form-heading h2 {
    font-size: 26px !important;
  }

  .form input,
  .field input,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"] {
    min-height: 54px !important;

    font-size: 16px !important;
  }

  .submit-btn,
  .form button[type="submit"] {
    min-height: 54px !important;
  }

}


/* ===========================
   SMALL MOBILE
   =========================== */

@media (max-width: 380px) {

  .form-panel {
    padding-left: 17px !important;
    padding-right: 17px !important;
  }

  .form-heading h1,
  .form-heading h2 {
    font-size: 24px !important;
  }

}


/* ===========================
   REDUCED MOTION
   =========================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

}



/* ===== PROGRESS ONLY FIX ===== */

/* فقط المان‌هایی که واقعاً مربوط به Progress هستند */
.progress,
.progress-label,
.progress-title,
[class~="progress"],
[class*="progress-label"],
[class*="progress-title"],
[data-label="progress"],
[aria-label="progress"],
[aria-label*="progress" i] {
    color: #111827 !important;
}

/* اگر Progress داخل المان فرزند باشد */
.progress *,
.progress-label *,
.progress-title * {
    color: #111827 !important;
}

/* رنگ‌های اصلی فرم را برگردان */
.form-heading h1,
.form-heading h2 {
    color: #1d2433 !important;
}

.form-heading p {
    color: #737b8c !important;
}

.form label {
    color: #353b48 !important;
}

.form-kicker {
    color: #625bf6 !important;
}

.brand-copy small {
    color: #9aa1ad !important;
}


/* ==========================================================
   AUTH INPUT ICON SPACING FIX
   ========================================================== */

/* فیلدهای دارای آیکون */
.form .field,
.form .input-wrap,
.form .input-group,
.form .form-group {
    position: relative !important;
}

/* نام و نام خانوادگی */
input[name="name"],
input[name="fullName"],
input[name="fullname"],
input[autocomplete="name"] {
    padding-right: 52px !important;
    padding-left: 16px !important;
}

/* رمز عبور
   راست: فضای آیکون قفل
   چپ: فضای دکمه نمایش رمز
*/
input[type="password"] {
    padding-right: 52px !important;
    padding-left: 76px !important;
}

/* اگر هنگام نمایش رمز type به text تغییر می‌کند */
.password-field input,
.field:has(.password-toggle) input,
.input-wrap:has(.password-toggle) input,
.input-group:has(.password-toggle) input {
    padding-right: 52px !important;
    padding-left: 76px !important;
}


/* ---------- icon on RIGHT ---------- */

.field-icon,
.input-icon,
.form-control-icon,
.input-wrap > svg,
.input-group > svg,
.field > svg {
    position: absolute !important;

    right: 16px !important;
    left: auto !important;

    top: 50% !important;
    transform: translateY(-50%) !important;

    width: 20px !important;
    height: 20px !important;

    color: #98a2b3 !important;

    pointer-events: none !important;

    z-index: 2 !important;
}


/* ---------- Show password button ---------- */

.password-toggle {
    position: absolute !important;

    left: 10px !important;
    right: auto !important;

    top: 50% !important;
    transform: translateY(-50%) !important;

    min-width: 56px !important;
    height: 36px !important;

    padding: 0 10px !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: #f5f6fa !important;

    border: 0 !important;
    border-radius: 10px !important;

    color: #555d6e !important;

    font-size: 11px !important;
    font-weight: 700 !important;

    z-index: 3 !important;
}


/* موبایل */
@media (max-width: 720px) {

    input[name="name"],
    input[name="fullName"],
    input[name="fullname"],
    input[autocomplete="name"],
    input[type="password"],
    .password-field input,
    .field:has(.password-toggle) input,
    .input-wrap:has(.password-toggle) input,
    .input-group:has(.password-toggle) input {
        padding-right: 50px !important;
    }

}

/* ===== PASSWORD FIELD PERMANENT SPACING FIX ===== */

/* رمز ورود */
input[name="password"],
input[name="Password"],
input[autocomplete="current-password"],
input[autocomplete="new-password"],

/* فیلدهایی که JS کلاس password-input به آن‌ها می‌دهد */
input.password-input {
    padding-right: 52px !important;
    padding-left: 76px !important;
}


/* آیکون قفل همیشه سمت راست */
.password-field .input-icon,
.password-field .field-icon,
.password-field > svg,
.input-wrap.password-field > svg,
.input-group.password-field > svg {
    right: 16px !important;
    left: auto !important;

    z-index: 2 !important;
}


/* دکمه نمایش همیشه سمت چپ */
.password-toggle {
    left: 10px !important;
    right: auto !important;

    z-index: 4 !important;
}
