/* استایل‌های پایه تاریشا (فاز ۱) — مکمل Tailwind و توکن‌ها */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-body); /* پایه ۱۶px در همه دستگاه‌ها */
  background-color: var(--color-bg-body);
  color: var(--color-text-main);
  line-height: var(--line-height-body);
  overflow-x: hidden;
}

/* فیلدهای فرم حداقل ۱۶px — جلوگیری از زوم خودکار iOS Safari هنگام فوکوس */
input, select, textarea {
  font-size: 1rem;
}

/* ارقام فارسی در متن‌های نمایشی */
.fa-digits {
  font-feature-settings: "ss01";
}

/* فوکوس واضح و دسترس‌پذیر در کل سایت */
:focus-visible {
  outline: 3px solid var(--color-brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* تایپوگرافی سند */
h1, .h1 { font-size: var(--font-size-h1-mobile); font-weight: 800; line-height: 1.4; }
h2, .h2 { font-size: var(--font-size-h2-mobile); font-weight: 700; line-height: 1.45; }
h3, .h3 { font-size: var(--font-size-h3); font-weight: 700; line-height: 1.5; }

@media (min-width: 768px) {
  h1, .h1 { font-size: var(--font-size-h1); }
  h2, .h2 { font-size: var(--font-size-h2); }
}

/* متن مقاله و محتوای Markdown (پیش‌نمایش فاز ۱) */
.prose-fa p { margin-bottom: 1rem; }
.prose-fa h2 { margin: 1.75rem 0 0.75rem; scroll-margin-top: 6.5rem; }
.prose-fa h3 { margin: 1.5rem 0 0.5rem; }
.prose-fa ul { list-style: disc; padding-inline-start: 1.5rem; margin-bottom: 1rem; }
.prose-fa pre {
  direction: ltr;
  text-align: left;
  background: var(--color-brand-primary);
  color: var(--color-on-dark);
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  /* متن کد و پرامپت در عرض ستون می‌پیچد تا خواننده (به‌ویژه در موبایل)
     برای دیدن و کپی‌کردن ادامه‌ی خط مجبور به اسکرول افقی نباشد. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
  line-height: 1.7;
}
.prose-fa code { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* تیتر Hero صفحه اصلی — مقیاس درشت و روان (۳۴px موبایل تا ۶۴px دسکتاپ) — وزن Black 900 */
.hero-title {
  font-size: clamp(2.125rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.35;
}

/* آکاردئون FAQ — بومی با details/summary، بدون جاوااسکریپت */
.faq-details summary { list-style: none; }
.faq-details summary::-webkit-details-marker { display: none; }
.faq-details .faq-chevron { transition: transform 0.25s ease; }
.faq-details[open ] summary .faq-chevron { transform: rotate(180deg); }
.faq-details summary:hover { color: var(--color-brand-primary); }

/* نوار متحرک برند (Marquee) زیر Hero صفحه اصلی */
.marquee { overflow: hidden; }
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* دکمه‌های آیکون شبکه‌های اجتماعی در فوتر */
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(230, 242, 239, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-on-dark);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.social-btn:hover {
  color: var(--color-brand-accent);
  border-color: var(--color-brand-accent);
}

/* اسلایدر Hero صفحه اصلی */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.hero-overlay {
  background: linear-gradient(100deg, rgba(23, 59, 67, 0.94) 15%, rgba(23, 59, 67, 0.72) 55%, rgba(23, 59, 67, 0.45) 100%);
}
.hero-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(230, 242, 239, 0.35);
  background: rgba(23, 59, 67, 0.45);
  color: var(--color-on-dark);
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, color 0.2s ease;
}
.hero-nav:hover {
  background: var(--color-brand-accent);
  color: var(--color-brand-primary);
}
.hero-dot {
  position: relative;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(230, 242, 239, 0.45);
  transition: all 0.3s ease;
  padding: 0;
}
/* ناحیه لمس بزرگ‌تر برای نقطه‌های اسلایدر، بدون تغییر ظاهر */
.hero-dot::after {
  content: "";
  position: absolute;
  inset: -0.65rem;
}
.hero-dot:hover { background: rgba(230, 242, 239, 0.8); }
.hero-dot.is-active {
  width: 1.75rem;
  background: var(--color-brand-accent);
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
}

/* زوم آرام کِن برنز روی تصویر اسلاید فعال Hero */
.hero-slide.is-active img {
  animation: hero-kenburns 8s ease-out forwards;
}
@keyframes hero-kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide.is-active img { animation: none; }
}

/* واترمارک انگلیسی محو پشت تیتر بخش‌های صفحه اصلی — زمزمه طراحی، نه تیتر دوم */
.has-watermark {
  position: relative;
  isolation: isolate;
}
.section-watermark {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: -1;
  text-align: center;
  font-weight: 800;
  font-size: clamp(2.75rem, 6.5vw, 6.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #E9E1CF;
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

/* قاب طاقی — امضای «دروازه تاریشا» روی تصاویر کلیدی */
.arch-frame {
  border-radius: 11rem 11rem 1.25rem 1.25rem;
}

/* بافت بسیار محو طاق روی بخش‌های روشن — SVG تکرارشونده سبک */
.pattern-arch {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cpath d='M26 70V44a16 16 0 0 1 32 0v26' fill='none' stroke='%23173B43' stroke-opacity='0.04' stroke-width='2.5'/%3E%3Ccircle cx='42' cy='14' r='2' fill='%23173B43' fill-opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ری‌اکشن کارت‌ها: لیفت ملایم + سایه عمیق‌تر + زوم ظریف کاور خدمت */
.card-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(23, 59, 67, 0.16);
}
.service-cover img {
  transition: transform 0.35s ease;
}
.card-lift:hover .service-cover img {
  transform: scale(1.05);
}
.tile-accent {
  transition: background-color 0.2s ease, color 0.2s ease;
}
.card-lift:hover .tile-accent {
  background-color: var(--color-brand-copper);
  color: var(--color-bg-body);
}
@media (prefers-reduced-motion: reduce) {
  .card-lift { transition: none; }
  .card-lift:hover { transform: none; }
  .service-cover img { transition: none; }
  .card-lift:hover .service-cover img { transform: none; }
}

/* بج نسخه نمایشی فاز ۱ */
.demo-badge {
  position: fixed;
  bottom: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 60;
  background: var(--color-brand-primary);
  color: var(--color-on-dark);
  border: 1px solid var(--color-brand-copper);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  opacity: 0.92;
  pointer-events: none;
}

/* ============================================================
   سامانه‌ی فرم و ناوبری پورتال مشتریان (بازطراحی ظاهری)
   موکاپ تأییدشده‌ی کاربر: آیکون پیشرو در فیلدها، حلقه‌ی فوکوس
   فیروزه‌ای، دراپ‌زون پیوست، کارت‌های بخشی و دکمه‌ی اصلی گرادیانی.
   آیکون‌ها از اسپرایت components/portal_icons.html می‌آیند و
   فیلدها با components/portal_field.html رندر می‌شوند.
   ============================================================ */

/* آیکون خطی یکدست (هم‌سبک موکاپ) */
.pf-ic {
  width: 21px;
  height: 21px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pf-ic-18 { width: 18px; height: 18px; }

/* سایدبار پورتال: گرادیان ملایم سبزآبی (همان خانواده‌ی رنگ برند) */
.portal-aside {
  background: linear-gradient(180deg, #1A4149 0%, var(--color-brand-primary) 34%, #102E35 100%);
}

/* پیوندهای ناوبری سایدبار پورتال */
.pnav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.8rem;
  border-radius: 13px;
  color: #C9DDD8;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}
.pnav-link .pf-ic { color: #7FC9BC; }
.pnav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.pnav-link.is-active {
  background: linear-gradient(90deg, rgba(37, 182, 166, 0.24), rgba(37, 182, 166, 0.10));
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(37, 182, 166, 0.28);
}
.pnav-link.is-active .pf-ic { color: #3ED3BF; }
/* نوار تأکیدی لبه‌ی سایدبار برای آیتم فعال — فقط دسکتاپ (در موبایل منو افقی است) */
@media (min-width: 768px) {
  .pnav-link.is-active::before {
    content: "";
    position: absolute;
    inset-inline-start: -0.75rem; /* برابر با padding ناوبری */
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 4px;
    background: var(--color-brand-accent);
  }
}
.pnav-link-sm { font-size: 0.84rem; color: #A9C8C1; }

/* ——— فیلدهای فرم ——— */
.pf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem 1.25rem;
}
@media (min-width: 768px) {
  .pf-grid { grid-template-columns: 1fr 1fr; }
  .pf-grid.pf-grid-1 { grid-template-columns: 1fr; } /* کارت‌های نیم‌صفحه: همیشه تک‌ستون */
  .pf-span-full { grid-column: 1 / -1; }
}
.pf-field { min-width: 0; }
.pf-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 0.45rem;
  padding-inline-start: 2px;
}
.pf-control { position: relative; }
.pf-control > .pf-ic {
  position: absolute;
  inset-inline-start: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: var(--color-icon-muted);
  pointer-events: none;
  z-index: 1;
}
.pf-control-area > .pf-ic { top: 1.3rem; transform: none; }
.pf-control > .pf-chev {
  inset-inline-start: auto;
  inset-inline-end: 0.8rem;
  width: 18px;
  height: 18px;
  color: var(--color-brand-copper);
}
/* ورودی‌های جهت‌چپ‌به‌راست (شماره موبایل و کد تأیید): آیکون سمت مقابل می‌نشیند */
.pf-control-flip > .pf-ic { inset-inline-start: auto; inset-inline-end: 0.875rem; }
.pf-control :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea) {
  width: 100%;
  background: var(--color-field-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  padding-block: 0.8rem;
  padding-inline-start: 2.9rem;
  padding-inline-end: 0.9rem;
  box-shadow: 0 2px 6px rgba(23, 59, 67, 0.035);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.pf-control select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 2.6rem; /* جا برای شورون */
  cursor: pointer;
}
.pf-control textarea { line-height: 1.9; }
.pf-control :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea):focus {
  border-color: var(--color-brand-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 182, 166, 0.16), 0 4px 12px rgba(23, 59, 67, 0.05);
  outline: none;
}
.pf-control:focus-within > .pf-ic { color: var(--color-accent-dark); }
.pf-control.has-error :is(input, select, textarea) { border-color: var(--color-danger); }
.pf-help {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--color-text-faint);
  margin-top: 0.55rem;
}
.pf-help .pf-ic { width: 15px; height: 15px; color: var(--color-accent-dark); margin-top: 0.2rem; }
.pf-error { color: var(--color-danger); font-size: 0.75rem; margin-top: 0.4rem; }

/* دراپ‌زون پیوست فایل */
.pf-dropzone {
  border: 1.8px dashed rgba(27, 140, 127, 0.45);
  background: linear-gradient(180deg, rgba(37, 182, 166, 0.055), rgba(37, 182, 166, 0.02));
  border-radius: 17px;
  padding: 1.4rem 1.1rem;
  text-align: center;
}
.pf-dz-ic {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(37, 182, 166, 0.3);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(23, 59, 67, 0.07);
}
.pf-dz-ic .pf-ic { width: 24px; height: 24px; }
.pf-dz-text { font-size: 0.9rem; font-weight: 600; color: var(--color-text-muted); }
.pf-dz-text b { color: var(--color-accent-dark); font-weight: 800; }
.pf-dropzone input[type="file"] { font-size: 0.85rem; max-width: 100%; margin-top: 0.6rem; }
.pf-dropzone input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-brand-primary);
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  padding: 0.45rem 1rem;
  margin-inline-end: 0.6rem;
  cursor: pointer;
}
.pf-dropzone input[type="file"]::file-selector-button:hover { border-color: var(--color-brand-accent); }
.pf-dz-hint { display: block; margin-top: 0.4rem; font-size: 0.75rem; color: var(--color-text-faint); font-weight: 500; }

/* سربرگ کارت بخشی فرم (تیتر + آیکون + زیرعنوان) */
.pf-card-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 1.1rem;
  border-bottom: 1.5px dashed #EFE8D6;
  margin-bottom: 1.4rem;
}
.pf-card-head .pf-hic {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(37, 182, 166, 0.16), rgba(37, 182, 166, 0.07));
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-card-head .pf-hic .pf-ic { width: 22px; height: 22px; }
.pf-card-head b { display: block; font-size: 1.03rem; font-weight: 800; color: var(--color-brand-primary); }
.pf-card-head span { font-size: 0.78rem; font-weight: 500; color: var(--color-text-faint); }

/* ——— دکمه‌های پورتال ——— */
.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 1.5px solid transparent;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.pbtn .pf-ic { width: 19px; height: 19px; }
.pbtn-primary {
  background: linear-gradient(120deg, var(--color-brand-primary) 5%, #1C655C 52%, var(--color-brand-accent) 105%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(27, 140, 127, 0.30);
  padding: 0.85rem 2.4rem;
}
.pbtn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.pbtn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-muted);
  font-weight: 600;
  padding: 0.8rem 1.6rem;
}
.pbtn-ghost:hover { border-color: var(--color-brand-accent); color: var(--color-brand-primary); }
.pbtn-danger {
  background: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
  font-weight: 700;
  padding: 0.8rem 1.6rem;
}
.pbtn-danger:hover { background: rgba(239, 68, 68, 0.06); }
.pbtn-sm { padding: 0.45rem 1.1rem; font-size: 0.78rem; }
/* دراپ‌زون فشرده برای فرم‌های درون‌ردیفی (مثل بارگذاری چک‌لیست) */
.pf-dropzone-sm { padding: 0.7rem 0.9rem; border-radius: 12px; text-align: start; }
.pf-dropzone-sm input[type="file"] { margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .pbtn-primary:hover { transform: none; }
}

/* ورود نرم کارت‌های فرم پورتال */
@keyframes pf-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.pf-rise { animation: pf-rise 0.55s ease both; }
.pf-rise-d { animation-delay: 0.1s; }
@media (prefers-reduced-motion: reduce) {
  .pf-rise, .pf-rise-d { animation: none; }
}

/* برچسب داده نمونه داخل صفحات */
.mock-tag {
  display: inline-block;
  background: #fdf3e3;
  color: #92600a;
  border: 1px dashed var(--color-warning);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.75rem; /* ۱۲px — کف اندازه متن در سایت */
  line-height: 1.6;
}
