/* ===== ماشین‌حساب مهریه به نرخ روز (طرح «Mehrie») =====
   روی home.css سوار است (رنگ‌ها، هدر، فوتر)؛ فقط بخش‌های خاص این صفحه اینجاست.
   منطق محاسبه در mehrie.js است (کپی web-app/src/lib/calculators/mehrie.ts). */

.blob1 { top: -260px; right: -160px; height: 640px; width: 640px; background: radial-gradient(closest-side, rgba(48,111,87,.14), rgba(48,111,87,0)); }
.blob2 { top: 40px; left: -220px; height: 560px; width: 560px; background: radial-gradient(closest-side, rgba(0,167,157,.09), rgba(0,167,157,0)); }

/* ---------- هیرو ---------- */
.mhero { position: relative; margin: 0 auto; max-width: 1100px; padding: 48px 24px 36px; text-align: center; }
.crumbs { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }
.crumbs a { padding: 8px 4px; color: var(--soft); }
.crumbs a:hover { color: var(--gd); }
.crumbs .cur { color: var(--sub); }
.mh-kick { margin-top: 18px; }
.mhero h1 { margin: 14px 0 0; font-size: clamp(30px, 4.6vw, 52px); font-weight: 900; line-height: 1.35; letter-spacing: -.02em; color: var(--ink); }
.mhero > p { margin: 16px auto 0; max-width: 42rem; font-size: clamp(15.5px, 1.5vw, 17px); line-height: 2.05; color: var(--muted); text-wrap: balance; }
.mh-stats { margin: 26px auto 0; max-width: 720px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mh-stat { border-radius: 20px; border: 1px solid var(--line); background: #ffffff; padding: 16px 20px; text-align: right; }
.mh-stat > div { font-size: 13px; line-height: 1.7; font-weight: 700; color: var(--soft); }
.mh-stat b { display: block; margin-top: 6px; font-size: 24px; line-height: 1.5; font-weight: 900; color: var(--ink); }
.mh-stat small { font-size: 14px; font-weight: 700; color: var(--soft); }
.mh-stat-g { border-color: #c3dacd; background: #f0f6f2; }
.mh-stat-g > div { color: #3f6b57; }

/* ---------- ماشین‌حساب ---------- */
.mh-calc-w { position: relative; margin: 0 auto; max-width: 1100px; padding: 0 24px 32px; }
.mh-calc { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); border-radius: 30px; border: 1px solid #dfe9e3; background: #ffffff; box-shadow: 0 1px 2px rgba(16,40,32,.04), 0 40px 80px -56px rgba(16,48,36,.45); }
.mh-form { display: flex; flex-direction: column; gap: 18px; padding: 34px; }
.mh-f > label { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: var(--sub); }
.mh-form input[type="text"], .mh-form select { width: 100%; height: 50px; border-radius: 13px; border: 1px solid #d7e3db; background: #ffffff; padding: 0 14px; font-family: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.mh-form input[type="text"]:focus, .mh-form select:focus { border-color: #a9cbb7; box-shadow: 0 0 0 3px rgba(48,111,87,.12); }
.mh-form select:disabled { opacity: .5; cursor: not-allowed; }
.mh-form input.mh-amount { font-size: 18px; font-weight: 800; }
.mh-form input::placeholder { color: var(--faint2); font-weight: 600; }
.mh-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mh-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mh-death { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #fafcfb; cursor: pointer; padding: 14px 16px; transition: all .2s; }
.mh-death input { position: absolute; opacity: 0; pointer-events: none; }
.mh-death:has(input:focus-visible) { outline: 2px solid var(--g); outline-offset: 2px; }
.mh-chk { display: grid; flex-shrink: 0; height: 22px; width: 22px; margin-top: 2px; place-items: center; border-radius: 7px; border: 1.5px solid #b9c7be; background: #ffffff; }
.mh-chk svg { visibility: hidden; }
.mh-death b { display: block; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.mh-death b + span { font-size: 12.5px; color: var(--soft); }
.mh-death.on { border-color: var(--g); background: #f0f6f2; }
.mh-death.on .mh-chk { border-color: var(--g); background: var(--g); }
.mh-death.on .mh-chk svg { visibility: visible; }
.mh-note, .mh-warn { margin: 10px 0 0; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.9; }
.mh-note { background: var(--mint2); color: var(--gd); }
.mh-warn { margin: 0; background: #fdf0e7; color: #9a3b12; }
.mh-disc { margin: auto 0 0; font-size: 12.5px; line-height: 1.9; color: var(--faint); }
[hidden].mh-f, .mh-note[hidden], .mh-warn[hidden], .mh-live[hidden] { display: none; }

.mh-out { position: relative; overflow: hidden; display: flex; flex-direction: column; background: linear-gradient(160deg, #337a5e 0%, #27583f 55%, #1b4230 100%); padding: 34px; }
.mh-out-mark { pointer-events: none; position: absolute; bottom: -50px; left: -20px; height: 220px; opacity: .07; }
.mh-out-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 700; color: rgba(255,255,255,.8); }
.mh-live { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: rgba(255,255,255,.14); padding: 3px 10px; font-size: 11.5px; font-weight: 700; color: #ffffff; }
.mh-live i { height: 6px; width: 6px; border-radius: 999px; background: #7fe0b0; }
.mh-result { position: relative; margin-top: 10px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 900; line-height: 1.3; color: #ffffff; overflow-wrap: anywhere; }
.mh-result span { font-size: 15px; font-weight: 700; color: rgba(255,255,255,.75); }
.mh-basis { position: relative; margin-top: 4px; font-size: 12.5px; color: rgba(255,255,255,.65); }
.mh-rows { position: relative; margin: 18px 0; }
.mh-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: 14px; }
.mh-rows dt { color: rgba(255,255,255,.75); }
.mh-rows dd { margin: 0; font-weight: 800; color: #ffffff; text-align: left; }
.mh-rows dd.mh-hl { color: #a8ecc8; }
.mh-print { position: relative; margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 13px; padding: 12px; font-size: 14.5px; font-weight: 800; border: none; background: #ffffff; color: var(--gd); cursor: pointer; transition: all .2s; }
.mh-print:hover { background: #f1f7f3; }
.mh-print:disabled { border: 1px solid rgba(255,255,255,.25); background: transparent; color: rgba(255,255,255,.5); cursor: not-allowed; }

.mh-strip { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; border-radius: 22px; border: 1px solid #c3dacd; background: linear-gradient(120deg, #eef6f1, #e3f1ec); padding: 18px 22px; }
.mh-strip > div { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 700; line-height: 1.85; color: var(--ink); }
.mh-strip-ic { display: grid; height: 44px; width: 44px; flex-shrink: 0; place-items: center; border-radius: 13px; background: var(--grad); }
.mh-strip-ic img { height: 22px; display: block; }
.mh-strip > a { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; border-radius: 12px; background: var(--grad); padding: 12px 20px; font-size: 14.5px; font-weight: 700; color: #ffffff; }
.mh-strip > a:hover { color: #ffffff; filter: brightness(1.06); }

/* ---------- عنوان بخش‌ها ---------- */
.mh-head { text-align: center; }
.mh-head h2 { margin: 14px 0 0; font-size: clamp(24px, 3.2vw, 36px); font-weight: 900; line-height: 1.5; color: var(--ink); text-wrap: balance; }
.mh-head p { margin: 12px 0 0; font-size: 15.5px; line-height: 1.95; color: var(--muted); }

/* ---------- جدول سال‌ها ---------- */
.mh-years { position: relative; margin: 0 auto; max-width: 900px; padding: 80px 24px 88px; }
.mh-tbl-w { margin-top: 28px; overflow: hidden; border-radius: 22px; border: 1px solid #dfe9e3; background: #ffffff; }
.mh-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mh-tbl th { background: #f0f6f2; padding: 14px 10px; font-size: 13px; font-weight: 800; color: #3f6b57; text-align: center; }
.mh-tbl th:nth-child(1), .mh-tbl th:nth-child(2) { width: 27%; }
.mh-tbl td { padding: 12px 10px; border-top: 1px solid var(--line2); font-size: 14px; text-align: center; }
.mh-tbl tbody tr:nth-child(even) td { background: #fafcfb; }
.mh-tbl td:nth-child(1) { font-weight: 800; color: var(--ink); }
.mh-tbl td:nth-child(2) { font-weight: 700; color: var(--gd); }
.mh-tbl td:nth-child(3) { font-weight: 600; color: #2f3833; font-variant-numeric: tabular-nums; }
/* همه‌ی سال‌ها در HTML هستند (برای گوگل)؛ تا زدن «نمایش همه» فقط ۱۲ ردیف اول دیده می‌شود */
.mh-tbl:not(.all) tbody tr:nth-child(n+13) { display: none; }
.mh-more { margin-top: 14px; text-align: center; }
.mh-more[hidden] { display: none; }
.mh-more button { border: 1px solid #cfe0d6; background: #ffffff; cursor: pointer; border-radius: 12px; padding: 10px 20px; font-size: 14px; font-weight: 700; color: var(--gd); }
.mh-more button:hover { background: #f2f6f3; }
.mh-tnote { margin: 14px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--faint); text-align: center; }

/* ---------- راهنما ---------- */
.mh-guide { background: var(--mint); border-top: 1px solid var(--line2); }
.mh-guide-in { margin: 0 auto; max-width: 1000px; padding: 80px 24px 88px; }
.mh-intro { margin: 18px auto 0; max-width: 46rem; text-align: center; font-size: 16.5px; line-height: 2.1; color: var(--sub); text-wrap: pretty; }
.mh-formula { margin: 30px auto 0; max-width: 820px; border-radius: 26px; border: 1px solid #dfe9e3; background: linear-gradient(160deg, #ffffff, #f3f9f5); padding: 30px 32px; box-shadow: 0 1px 2px rgba(16,40,32,.04), 0 30px 60px -48px rgba(16,48,36,.4); }
.mh-f-t { text-align: center; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: var(--g); }
.mh-f-row { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tk { display: inline-flex; align-items: center; border-radius: 10px; border: 1px solid #cfe0d6; background: #ffffff; padding: 10px 14px; font-size: 14.5px; font-weight: 800; line-height: 1.5; white-space: nowrap; color: var(--ink); }
.tk-g { border-color: var(--g); background: var(--g); color: #ffffff; }
.tk .sm { display: none; }
.op { font-size: 22px; font-weight: 900; color: #6b8a79; }
.mh-ex { margin-top: 20px; display: flex; gap: 12px; border-radius: 16px; background: var(--mint2); padding: 14px 16px; }
.mh-ex > span { display: grid; height: 30px; min-width: 30px; flex-shrink: 0; place-items: center; border-radius: 9px; background: var(--g); padding: 0 6px; font-size: 13px; font-weight: 900; color: #ffffff; }
.mh-ex p { margin: 0; font-size: 15px; line-height: 2; color: #27402f; }
.mh-cards { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mh-card { display: flex; flex-direction: column; scroll-snap-align: start; border-radius: 24px; border: 1px solid #d3e2d9; background: #ffffff; padding: 24px; box-shadow: 0 1px 2px rgba(16,40,32,.04); }
.mh-card-ic { display: grid; height: 46px; width: 46px; place-items: center; border-radius: 14px; background: var(--mint2); color: var(--g); }
.mh-card h3 { margin: 16px 0 0; font-size: 17.5px; font-weight: 800; line-height: 1.7; color: var(--ink); }
.mh-card p { margin: 8px 0 0; font-size: 14.5px; line-height: 2.05; color: var(--muted); }

/* ---------- پرسش‌ها (مثل صفحه‌ی تماس) ---------- */
.mh-faq { background: #ffffff; border-top: 1px solid var(--line2); }
.mh-faq-in { margin: 0 auto; max-width: 820px; padding: 80px 24px 88px; }
.faqs { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.faqs details { overflow: hidden; border-radius: 18px; border: 1px solid #e3ece6; background: #ffffff; transition: all .2s; }
.faqs details[open] { border-color: #cfe0d6; box-shadow: 0 18px 40px -30px rgba(16,48,36,.4); }
.faqs summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; padding: 18px 20px; list-style: none; font-size: 15.5px; font-weight: 800; color: var(--ink); }
.faqs summary::-webkit-details-marker { display: none; }
.faqs summary:focus-visible { outline: 2px solid var(--g); outline-offset: -2px; border-radius: 18px; }
.fq-ic { display: grid; flex-shrink: 0; height: 30px; width: 30px; place-items: center; border-radius: 10px; background: var(--mint2); color: var(--g); transition: transform .25s; }
.faqs details[open] .fq-ic { background: var(--g); color: #ffffff; transform: rotate(45deg); }
.faqs details p { margin: 0; padding: 0 20px 20px; font-size: 15px; line-height: 2.05; color: var(--muted); animation: rise .3s var(--ease) both; }

/* ---------- موبایل ---------- */
@media (max-width: 820px) {
  .mhero { padding: 32px 20px 28px; }
  .mh-stat { padding: 12px 14px; }
  .mh-stat > div { font-size: 11.5px; }
  .mh-stat b { font-size: 18px; }
  .mh-stat small { font-size: 11.5px; }
  .mh-calc-w { padding: 0 14px 32px; }
  .mh-calc { grid-template-columns: minmax(0, 1fr); }
  .mh-form, .mh-out { padding: 22px 20px; }
  .mh-strip { flex-direction: column; align-items: stretch; padding: 18px; }
  .mh-strip > div { align-items: flex-start; font-size: 14px; }
  .mh-years, .mh-guide-in, .mh-faq-in { padding: 56px 20px 64px; }
  .mh-tbl th, .mh-tbl td { padding-inline: 6px; }
  .mh-tbl th:nth-child(1) { width: 64px; }
  .mh-tbl th:nth-child(2) { width: 76px; }
  .mh-formula { padding: 20px 10px; }
  .mh-f-row { gap: 3px; flex-wrap: nowrap; }
  .tk { padding: 5px 6px; font-size: min(11px, 2.9vw); }
  .tk .lg { display: none; }
  .tk .sm { display: inline; }
  .op { font-size: min(15px, 3.8vw); }
  /* کارت‌های راهنما: ردیف افقی با اسکرول */
  .mh-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -20px; padding: 0 20px 8px; scroll-padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .faqs details p { animation: none; }
}
