/* =========================================================
   هدر، کشوی منوی موبایل، پاپ‌آپ «ارسال پیام»
   مشترک بین همه‌ی صفحات
   ========================================================= */

:root {
  --brand: #ff6a00;
  --brand-hover: #ff7d1f;
  --brand-ink: #1c0b02;
  --surface: #160a04;
  --surface-line: rgba(255, 255, 255, .09);
  --header-h: 88px;
  --header-h-scrolled: 68px;
}

html { scrollbar-gutter: stable; color-scheme: dark; }
body.is-locked { overflow: hidden; }

/* ---------------------------------------------------------
   هدر
   --------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  color: #fff;
  transition: height .5s var(--ease-out);
}
/* لایه‌ی شیشه‌ای جدا تا فقط opacity انیمیت شود (روان‌تر از انیمیت backdrop-filter) */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(18, 9, 3, .72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--surface-line);
  opacity: 0;
  transition: opacity .5s var(--ease-out);
}
.site-header.is-scrolled { height: var(--header-h-scrolled); }
.site-header.is-scrolled::before,
.site-header:not([data-transparent])::before { opacity: 1; }

/* در حالت شفاف روی تصویر روشن، سایه‌ی نرم خوانایی را تضمین می‌کند */
.site-header[data-transparent]:not(.is-scrolled) .brand,
.site-header[data-transparent]:not(.is-scrolled) .nav__link,
.site-header[data-transparent]:not(.is-scrolled) .burger {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)) drop-shadow(0 2px 10px rgba(0, 0, 0, .22));
}

.site-header__inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;  /* منو دقیقاً وسط صفحه، مستقل از عرض لوگو و دکمه */
  align-items: center;
  gap: 32px;
  padding: 0 var(--gutter);
}

/* ---------- لوگو ---------- */
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: 8px;
}
.brand__mark {
  display: block;
  width: 40px;
  height: 40px;
  transition: width .5s var(--ease-out), height .5s var(--ease-out);
}
.brand__word {
  display: block;
  width: auto;
  height: 15px;
  transition: height .5s var(--ease-out);
}
.site-header.is-scrolled .brand__mark { width: 34px; height: 34px; }
.site-header.is-scrolled .brand__word { height: 13px; }
.brand:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

/* ---------- منو ---------- */
.nav { display: flex; justify-content: center; }
.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.1vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, .86);
  text-decoration: none;
  white-space: nowrap;
  transition: color .3s var(--ease-out);
}
.nav__link::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center; /* RTL: از راست باز می‌شود */
  transition: transform .45s var(--ease-out);
}
.nav__link:hover,
.nav__link:focus-visible,
.nav__link.is-active { color: #fff; }
.nav__link:hover::after,
.nav__link:focus-visible::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link:focus-visible { outline: none; }

/* ---------- دکمه‌ها ---------- */
.site-header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 24px -8px rgba(0, 0, 0, .35);
  transition: background .35s var(--ease-out), color .35s var(--ease-out), transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.cta__label { overflow: hidden; text-overflow: ellipsis; }
.cta__icon { flex: none; }
.cta:hover,
.cta:focus-visible {
  background: var(--brand);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -10px rgba(255, 106, 0, .7);
}
.cta:active { transform: translateY(0); }
.cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.cta--block { width: 100%; height: 52px; background: var(--brand); color: #fff; }
.cta--block:hover,
.cta--block:focus-visible { background: var(--brand-hover); }
.cta--submit { height: 52px; padding: 0 36px; background: var(--brand); color: #fff; margin-top: 8px; }
.cta--submit:hover,
.cta--submit:focus-visible { background: var(--brand-hover); }

.burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.burger span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1.75px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .35s var(--ease-out), width .35s var(--ease-out);
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 21px; width: 16px; }
.burger span:nth-child(3) { top: 27px; }
.burger:hover span:nth-child(2) { width: 22px; }
.burger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--surface-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  cursor: pointer;
  transition: background .3s var(--ease-out), transform .45s var(--ease-out);
}
.icon-btn:hover,
.icon-btn:focus-visible { background: rgba(255, 255, 255, .1); transform: rotate(90deg); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------------------------------------
   کشوی منوی موبایل
   --------------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  transition: visibility 0s linear .6s;
}
.drawer.is-open { visibility: visible; transition: none; }

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 1, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .5s var(--ease-out);
}
.drawer.is-open .drawer__backdrop { opacity: 1; }

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 86vw);
  display: flex;
  flex-direction: column;
  padding: 20px 24px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(255, 106, 0, .16), transparent 60%),
    var(--surface);
  border-left: 1px solid var(--surface-line);
  box-shadow: -30px 0 80px -20px rgba(0, 0, 0, .6);
  transform: translateX(100%);
  transition: transform .6s var(--ease-out);
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}
.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}
.brand--sm .brand__mark { width: 34px; height: 34px; }
.brand--sm .brand__word { height: 13px; }

.drawer__list {
  margin: 40px 0 32px;
  padding: 0;
  list-style: none;
  flex: 1;
}
.drawer__list li {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-out);
}
.drawer.is-open .drawer__list li { opacity: 1; transform: none; }
.drawer.is-open .drawer__list li:nth-child(1) { transition-delay: .08s; }
.drawer.is-open .drawer__list li:nth-child(2) { transition-delay: .12s; }
.drawer.is-open .drawer__list li:nth-child(3) { transition-delay: .16s; }
.drawer.is-open .drawer__list li:nth-child(4) { transition-delay: .20s; }
.drawer.is-open .drawer__list li:nth-child(5) { transition-delay: .24s; }
.drawer.is-open .drawer__list li:nth-child(6) { transition-delay: .28s; }
.drawer.is-open .drawer__list li:nth-child(7) { transition-delay: .32s; }

.drawer__link {
  display: flex;
  align-items: center;
  height: 56px;
  border-bottom: 1px solid var(--surface-line);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  white-space: nowrap;
  transition: color .3s var(--ease-out), padding .4s var(--ease-out);
}
.drawer__link::before {
  content: "";
  width: 0;
  height: 2px;
  margin-left: 0;
  border-radius: 2px;
  background: var(--brand);
  transition: width .4s var(--ease-out), margin .4s var(--ease-out);
}
.drawer__link:hover,
.drawer__link:focus-visible,
.drawer__link.is-active { color: #fff; }
.drawer__link:hover::before,
.drawer__link:focus-visible::before,
.drawer__link.is-active::before { width: 16px; margin-left: 12px; }
.drawer__link:focus-visible { outline: none; }

/* ---------------------------------------------------------
   پاپ‌آپ
   --------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  visibility: hidden;
  transition: visibility 0s linear .45s;
}
.modal.is-open { visibility: visible; transition: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 1, .62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .45s var(--ease-out);
}
.modal.is-open .modal__backdrop { opacity: 1; }

.modal__dialog {
  position: relative;
  width: min(580px, 100%);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 40px 36px;
  border: 1px solid var(--surface-line);
  border-radius: 24px;
  background:
    radial-gradient(90% 50% at 100% 0%, rgba(255, 106, 0, .14), transparent 60%),
    var(--surface);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .75);
  color: #fff;
  opacity: 0;
  transform: translateY(18px) scale(.98);
  transition: opacity .45s var(--ease-out), transform .55s var(--ease-out);
  outline: none;
}
.modal.is-open .modal__dialog { opacity: 1; transform: none; }

.modal__close { position: absolute; top: 35px; left: 36px; }  /* هم‌راستا با مرکز عنوان */
.modal__title {
  margin: 0 0 28px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

/* ---------- فرم ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(255, 255, 255, .72);
}
.field__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.field__input[dir="ltr"] { text-align: left; }
.field__input--area {
  height: auto;
  min-height: 132px;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.9;
}
.field__input:hover { border-color: rgba(255, 255, 255, .22); }
.field__input:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, .22);
}
.form.was-validated .field__input:invalid { border-color: #ff5a4a; }

/* ---------------------------------------------------------
   ریسپانسیو
   --------------------------------------------------------- */
@media (max-width: 1023px) {
  :root { --header-h: 72px; --header-h-scrolled: 64px; }
  .nav,
  .site-header__actions > .cta { display: none; }
  .burger { display: inline-block; }
  .site-header__inner { grid-template-columns: 1fr auto; }
  .brand__mark { width: 36px; height: 36px; }
  .brand__word { height: 13px; }
  .site-header.is-scrolled .brand__mark { width: 32px; height: 32px; }
  .site-header.is-scrolled .brand__word { height: 12px; }
}

@media (max-width: 559px) {
  .form__row { grid-template-columns: 1fr; }
  .modal__dialog { padding: 32px 22px 24px; border-radius: 20px; }
  .modal__close { top: 26px; left: 18px; }
  .modal__title { font-size: 22px; margin-bottom: 22px; }
  .cta--submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header::before,
  .drawer__panel,
  .drawer__list li,
  .modal__dialog { transition-duration: .01s !important; transition-delay: 0s !important; }
}
