/* =========================================================
   landing.css — استایلِ اختصاصیِ صفحه‌ی ورود/ثبت‌نام (index.html)

   این فایل کاملاً مستقله و style.css رو لازم نداره؛ یعنی صفحه‌ی
   ورود با استایلِ داشبورد/بانک سؤال قاطی نمی‌شه و می‌تونیم بدون
   ترسِ خراب‌شدنِ بقیه‌ی پنل‌ها اینجا هرچی خواستیم عوض کنیم.

   طرح: صفحه دو ستونه‌ست.
     سمتِ راست  → عکسِ کتاب/کلاهِ فارغ‌التحصیلی (assets/img/login-back.jpg)
     سمتِ چپ    → کارتِ شیشه‌ایِ ورود، روی همون عکس ولی بلور و تیره‌شده

   پالت از خودِ عکس درآمده و با لوگوی پرسش‌لند هماهنگ شده:
     زغالیِ گرم #17120F | کرم #F3E8D8 | کهربایی #F8AC11
     آبیِ کتاب #3E5468 | آجریِ کتاب #9A4E3C
========================================================= */


/* ---------- ۰) فونت‌های محلی ---------- */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}


/* ---------- ۱) ریست + توکن‌ها ---------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* زغالی‌های گرمِ عکس */
  --night:      #17120F;
  --night-2:    #221B16;
  --night-3:    #2E251F;

  /* کرمِ متنِ عکس */
  --cream:      #F3E8D8;
  --cream-soft: rgba(243, 232, 216, 0.72);
  --cream-dim:  rgba(243, 232, 216, 0.46);

  /* کهربایی لوگو + منگوله‌ی کلاه */
  --amber:      #F8AC11;
  --amber-deep: #D98A0C;
  --gold:       #FDCC50;
  --amber-ink:  #3A2401;

  /* رنگِ جلدِ کتاب‌ها */
  --steel:      #3E5468;
  --clay:       #9A4E3C;

  --red:        #E5766A;
  --green:      #6FCF97;

  /* شیشه */
  --glass-fill:   rgba(255, 255, 255, 0.07);
  --glass-fill-2: rgba(255, 255, 255, 0.13);
  --glass-line:   rgba(255, 255, 255, 0.16);
  --glass-line-2: rgba(255, 255, 255, 0.30);

  --font-display: "Lalezar", "Vazirmatn", sans-serif;
  --font-body:    "Vazirmatn", system-ui, sans-serif;

  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.landing {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  color: var(--cream);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 8px;
}


/* ---------- ۲) صحنه‌ی یکپارچه ----------
   عمداً هیچ ستون‌بندی‌ای وجود ندارد: کلِ صفحه یک لایه است و کارت
   روی آن شناور. چون مرزی بین دو ناحیه نیست، هیچ خط عمودی‌ای هم
   نمی‌تواند ساخته شود. */

.page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;      /* در RTL یعنی سمتِ چپ؛ فاصله‌اش را margin زیر تعیین می‌کند */
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 4vw, 76px);
}

.page__frame {
  display: contents;
}

.page__photo {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 100% 50%;
}

/* هاله‌های نور: دایره‌های محوشده‌ی بدون لبه، روی خودِ صفحه */
.page__glow {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}

.page__glow--amber {
  width: min(44vw, 620px);
  aspect-ratio: 1;
  top: -24%;
  right: 46%;
  background: rgba(248, 172, 17, 0.22);
}

.page__glow--steel {
  width: min(54vw, 720px);
  aspect-ratio: 1;
  bottom: -28%;
  right: 62%;
  background: rgba(62, 84, 104, 0.42);
}


/* ---------- ۳) ناحیه‌ی کارت ---------- */

.gate {
  position: relative;
  display: flex;
  justify-content: center;
  width: min(100%, 470px);

  /* کارت را به وسط می‌بَرد و همیشه حدودِ ۱۰۰ تا ۱۵۰ پیکسل روی لبه‌ی
     کتاب‌ها می‌نشیند. چون جای کتاب‌ها با نسبتِ پنجره جابه‌جا می‌شود،
     این مقدار از خودِ ابعادِ پنجره حساب می‌شود نه یک عددِ ثابت. */
  margin-inline-end: clamp(0px, calc(100vw - 100vh - 340px), 46vw);
}


/* ---------- ۴) کارتِ شیشه‌ای ---------- */

.glass {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: clamp(26px, 3vw, 38px) clamp(22px, 2.6vw, 34px) clamp(24px, 2.6vw, 32px);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-xl);
  background:
    linear-gradient(155deg, var(--glass-fill-2) 0%, var(--glass-fill) 42%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(30px) saturate(155%);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
  box-shadow:
    0 32px 70px -28px rgba(0, 0, 0, 0.85),
    0 2px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 var(--glass-line-2);
}

/* هاله‌ی نازکِ نور دورِ کارت — همون افکتِ نئونِ عکسِ دوم، ولی کهربایی */
.glass::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg,
    rgba(253, 204, 80, 0.55),
    rgba(255, 255, 255, 0.06) 38%,
    rgba(255, 255, 255, 0) 62%,
    rgba(62, 84, 104, 0.45));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}

.glass__mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

.glass__names {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.glass__wordmark {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.2px;
}

.glass__tagline {
  font-size: 11.5px;
  color: var(--cream-dim);
}

.glass__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.35;
  color: var(--cream);
}

.glass__subtitle {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--cream-soft);
}

.glass__foot {
  margin-top: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--cream-dim);
}

.glass__foot a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(253, 204, 80, 0.35);
  padding-bottom: 1px;
  transition: border-color .2s ease, color .2s ease;
}

.glass__foot a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
}


/* ---------- ۶) فرم ---------- */

.auth__form {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 12.5px;
  color: var(--cream-soft);
  padding-inline-start: 4px;
}

.field__input-wrap {
  position: relative;
  display: block;
}

.field__input {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  color: var(--cream);
  font-size: 14.5px;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field__input--padded {
  padding-left: 50px;   /* جا برای دکمه‌ی چشم */
}

.field__input--ltr {
  direction: ltr;
  text-align: left;
}

.field__input::placeholder {
  color: rgba(243, 232, 216, 0.34);
}

.field__input:hover {
  background-color: rgba(255, 255, 255, 0.10);
}

.field__input:focus {
  outline: none;
  border-color: rgba(248, 172, 17, 0.65);
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(248, 172, 17, 0.14);
}

/* سلکت‌ها: فلشِ اختصاصی، چون appearance رو خاموش کردیم */
.field__input--select {
  padding-left: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.2 1.4 7 7.2l5.8-5.8' stroke='%23F3E8D8' stroke-opacity='.66' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 18px center;
  background-size: 13px 8px;
}

.field__input--select option {
  background: var(--night-2);
  color: var(--cream);
}

/* پرکردنِ خودکارِ مرورگر رنگِ کارت رو خراب نکنه */
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cream);
  -webkit-box-shadow: 0 0 0 60px #2A221C inset;
  caret-color: var(--cream);
}

/* دکمه‌ی نمایش رمز */
.field__toggle {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--cream-dim);
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}

.field__toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  color: var(--cream);
}

.field__toggle svg {
  width: 20px;
  height: 20px;
}

/* کدوم آیکون دیده بشه از روی aria-pressed تصمیم گرفته می‌شه.
   دلیل: login.js/register.js روی تگِ <svg> پراپرتیِ .hidden رو ست می‌کنن،
   ولی hidden فقط رویِ HTMLElement تعریف شده و رویِ SVGElement بی‌اثره —
   برای همین آیکونِ چشم هیچ‌وقت عوض نمی‌شد. aria-pressed اما درست ست می‌شه. */
.field__toggle .icon-eye,
.field__toggle[aria-pressed="false"] .icon-eye {
  display: block;
}

.field__toggle .icon-eye-off,
.field__toggle[aria-pressed="false"] .icon-eye-off {
  display: none;
}

.field__toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.field__toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.field__toggle svg[hidden] {
  display: none;
}

/* خطا */
.field__error {
  display: none;
  font-size: 12px;
  color: var(--red);
  padding-inline-start: 6px;
}

.field--invalid .field__error {
  display: block;
}

.field--invalid .field__input {
  border-color: rgba(229, 118, 106, 0.7);
  background-color: rgba(229, 118, 106, 0.10);
}

.field--invalid .field__input:focus {
  box-shadow: 0 0 0 4px rgba(229, 118, 106, 0.16);
}

.auth__forgot,
.auth__otp {
  align-self: flex-start;
  font-size: 12.5px;
  color: var(--cream-soft);
  text-decoration: none;
  transition: color .2s ease;
}

.auth__otp {
  align-self: center;
  color: var(--gold);
}

.auth__forgot:hover,
.auth__otp:hover {
  color: var(--amber);
}

.auth__note {
  display: none;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
  border: 1px solid rgba(111, 207, 151, 0.35);
  background: rgba(111, 207, 151, 0.12);
  color: var(--green);
}

.auth__note.is-visible {
  display: block;
}

.auth__note--error {
  border-color: rgba(229, 118, 106, 0.4);
  background: rgba(229, 118, 106, 0.12);
  color: var(--red);
}

.auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--cream-dim);
  font-size: 12px;
}

.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(243, 232, 216, 0.16);
}


/* ---------- ۷) دکمه‌ها ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, background-color .2s ease, border-color .2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.btn--primary {
  margin-top: 4px;
  color: var(--amber-ink);
  background: linear-gradient(180deg, var(--gold) 0%, var(--amber) 55%, var(--amber-deep) 100%);
  box-shadow:
    0 12px 30px -12px rgba(248, 172, 17, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn--primary:hover:not(:disabled) {
  box-shadow:
    0 18px 40px -12px rgba(248, 172, 17, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn--ghost {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-line);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--glass-line-2);
}

/* حالتِ درحال‌ارسال */
.btn__spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(58, 36, 1, 0.28);
  border-top-color: var(--amber-ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn.is-loading .btn__label {
  opacity: 0.55;
}

.btn.is-loading .btn__spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ---------- ۸) مودالِ ثبت‌نام ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(10, 7, 5, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-overlay.active {
  display: flex;
}

.glass--modal {
  margin: auto;
  max-width: 460px;
  animation: rise .34s cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--cream-soft);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--cream);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

/* لرزشِ کارت وقتی ورودی غلطه یا سرور خطا داد */
.shake {
  animation: shake .42s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}


/* ---------- ۹) ورودِ نرمِ صفحه ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}

.js body.is-ready .reveal,
body.is-ready .reveal {
  opacity: 1;
  transform: none;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .25, 1);
}

body.is-ready .reveal[data-reveal="1"] { transition-delay: .05s; }
body.is-ready .reveal[data-reveal="2"] { transition-delay: .16s; }
body.is-ready .reveal[data-reveal="3"] { transition-delay: .28s; }


/* ---------- ۹) جاشدن در یک صفحه، بدونِ اسکرول ---------- */

@media (min-width: 901px) {
  html, body.landing {
    height: 100%;
    overflow: hidden;
  }

  .page {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }
}

/* پنجره‌های کوتاه (لپ‌تاپ‌های ۷۶۸p و پایین‌تر): فشرده‌سازیِ فاصله‌ها */
@media (min-width: 901px) and (max-height: 820px) {
  .glass {
    max-width: 405px;
    padding: 22px 26px 20px;
  }
  .glass__brand { margin-bottom: 12px; }
  .glass__mark { width: 38px; height: 38px; }
  .glass__title { font-size: 24px; }
  .auth__form { margin-top: 16px; gap: 11px; }
  .field { gap: 5px; }
  .field__input { height: 46px; }
  .btn { min-height: 47px; }
  .auth__divider { margin: 14px 0 10px; }
  .glass__foot { margin-top: 12px; }
}

@media (min-width: 901px) and (max-height: 700px) {
  .glass__subtitle { display: none; }
  .field__label { font-size: 12px; }
  .field__input { height: 44px; }
}

/* پنجره‌های خیلی کوتاه: اسکرول برمی‌گردد تا محتوا له نشود */
@media (min-width: 901px) and (max-height: 560px) {
  html, body.landing {
    height: auto;
    overflow: auto;
  }
  .page {
    height: auto;
    min-height: 100vh;
  }
}


/* ---------- ۱۰) واکنش‌گرایی ---------- */

@media (max-width: 1150px) {
  .glass {
    max-width: 380px;
  }

  /* روی صفحه‌های باریک‌تر کارت وسط می‌نشیند و تصویر کمی
     به سمت راستِ کادر می‌رود تا کتاب‌ها کامل دیده شوند */
  .page__photo {
    object-position: 100% 50%;
  }
}

@media (max-width: 900px) {
  /* روی موبایل تصویر بالای صفحه می‌نشیند و کارت زیرش می‌آید،
     پس هیچ‌وقت روی هم نمی‌افتند */
  .page {
    display: block;
    padding: 0 18px 30px;
  }

  .page__photo {
    height: clamp(230px, 44vh, 420px);
    object-position: 93% 48%;
    -webkit-mask-image: linear-gradient(to bottom, #000 58%, rgba(0, 0, 0, 0) 99%);
    mask-image: linear-gradient(to bottom, #000 58%, rgba(0, 0, 0, 0) 99%);
  }

  .gate {
    margin: 0 auto;
    padding-top: clamp(212px, 40vh, 390px);
  }

  .page__glow--amber { top: 4%; right: 8%; width: 70vw; }
  .page__glow--steel { bottom: -10%; right: 30%; width: 90vw; }

  .gate {
    width: 100%;
  }
}

@media (max-width: 480px) {

  .glass {
    padding: 24px 20px 22px;
    border-radius: 24px;
  }

  .glass__title {
    font-size: 25px;
  }
}


/* ---------- ۱۱) دسترس‌پذیری ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* مرورگرهایی که backdrop-filter ندارن، شیشه رو مات‌تر می‌بینن تا متن خونا بمونه */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(34, 27, 22, 0.92);
  }
  .modal-overlay {
    background: rgba(10, 7, 5, 0.93);
  }
}