@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-UI-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-UI-FD-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-UI-FD-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-UI-FD-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --night: #1c1529;
  --night-2: #2a2140;
  --night-ink: #f1edf8;
  --night-mute: #b9b0cc;
  --paper: #f7f5fb;
  --surface: #ffffff;
  --sunken: #f0edf6;
  --ink: #231a33;
  --ink-2: #5f5675;
  --ink-3: #958ea8;
  --line: #e5e1ee;
  --line-strong: #d3cde0;
  --beam: #d63a70;
  --beam-ink: #b02a5a;
  --beam-soft: #fbe7ee;
  --ok: #15907d;
  --ok-soft: #dcf2ed;
  --danger: #c6372f;
  --danger-soft: #fbe4e2;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16121e;
    --surface: #1f1a2a;
    --sunken: #2a2338;
    --ink: #f1edf8;
    --ink-2: #b9b0cc;
    --ink-3: #847b98;
    --line: #2f2840;
    --line-strong: #40374f;
    --beam: #f0588b;
    --beam-ink: #ff86ad;
    --beam-soft: #3a1d2b;
    --ok: #3cc2ab;
    --ok-soft: #173430;
    --danger: #f06b62;
    --danger-soft: #3d1c1a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 16px; line-height: 1.8;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { min-height: 100dvh; display: grid; place-items: center; background: var(--night); }
.boot-beam { width: 140px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--beam), #fff, transparent); animation: sweep 1.2s ease-in-out infinite; }
@keyframes sweep { 50% { transform: scaleX(.4); opacity: .5; } }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--night); color: var(--night-ink);
  padding: 22px 20px 0;
}
.hero-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: end; }
.top { max-width: 1080px; margin: 0 auto 56px; display: flex; align-items: center; gap: 12px; }
.mark { width: 36px; height: 36px; border-radius: 11px; background: #fff; position: relative; flex: none; overflow: hidden; }
.mark::before { content: ""; position: absolute; inset-inline: 6px; top: 50%; height: 2px; margin-top: -1px; background: linear-gradient(90deg, transparent, var(--beam) 30%, var(--night) 70%, var(--beam)); }
.mark::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; top: 50%; inset-inline-start: 7px; transform: translateY(-50%); background: var(--night); box-shadow: 0 0 0 3px rgba(214, 58, 112, .5); }
.top b { font-weight: 900; font-size: 17px; }
.top .call { margin-inline-start: auto; }

.hero h1 { font-size: clamp(30px, 5.4vw, 54px); font-weight: 900; line-height: 1.3; letter-spacing: -.5px; max-width: 16ch; }
.hero .lead { margin-top: 16px; color: var(--night-mute); font-size: 17px; max-width: 46ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.facts { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--night-mute); font-size: 14px; }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts svg { width: 18px; height: 18px; color: var(--beam); flex: none; }

/* پرتو: عنصر شاخص صفحه */
.beams { position: relative; height: 100%; min-height: 300px; }
.beams::before {
  content: ""; position: absolute; inset: 10% 6% 0;
  background: radial-gradient(closest-side, rgba(214, 58, 112, .35), transparent 70%);
  filter: blur(10px);
}
.beam-line {
  position: absolute; inset-inline: -30%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #f0588b 35%, #fff 55%, transparent 80%);
  box-shadow: 0 0 18px rgba(240, 88, 139, .75);
  transform: rotate(-16deg); transform-origin: center;
  animation: fire 1.4s var(--ease) both;
}
.beam-line:nth-child(2) { animation-delay: .12s; }
.beam-line:nth-child(3) { animation-delay: .24s; }
.beam-line:nth-child(4) { animation-delay: .36s; }
@keyframes fire { from { clip-path: inset(0 0 0 100%); opacity: 0; } to { clip-path: inset(0 0 0 0); opacity: var(--o, 1); } }
.wave { display: block; width: calc(100% + 40px); height: 40px; margin: 46px -20px -1px; color: var(--paper); }

/* ============ Buttons / controls ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 19px; height: 19px; }
.btn-beam { background: var(--beam); color: #fff; }
.btn-beam:hover { background: var(--beam-ink); }
.btn-ghost-night { border-color: rgba(255, 255, 255, .22); color: var(--night-ink); background: transparent; }
.btn-ghost-night:hover { background: rgba(255, 255, 255, .08); }
.btn-line { border-color: var(--line-strong); background: var(--surface); }
.btn-line:hover { background: var(--sunken); }
.btn-sm { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; border-color: #fff transparent #fff transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Sections ============ */
main { max-width: 1080px; margin: 0 auto; padding: 8px 20px 80px; }
.steps { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-block: 1px solid var(--line); }
.steps li { padding: 18px 18px 18px 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: baseline; }
.steps li + li { border-inline-start: 1px solid var(--line); padding-inline-start: 18px; }
.steps .n { grid-row: span 2; font-size: 30px; font-weight: 900; line-height: 1; color: var(--beam); }
.steps b { font-size: 15px; }
.steps span { font-size: 13.5px; color: var(--ink-2); }

.book { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; scroll-margin-top: 16px; }
.book-head { grid-column: 1 / -1; }
.book-head h2 { font-size: 28px; font-weight: 900; letter-spacing: -.3px; }
.book-head p { color: var(--ink-2); margin-top: 4px; }

.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.form { padding: 6px 0; }
.block { padding: 20px 22px; }
.block + .block { border-top: 1px solid var(--line); }
.block > h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 900; margin-bottom: 14px; }
.block > h3 .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--ink); color: var(--paper); }
.block > h3 small { font-weight: 500; font-size: 13px; color: var(--ink-3); margin-inline-start: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); cursor: pointer; font-size: 14.5px; line-height: 1.7;
  transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { border-color: var(--beam); color: var(--ink); }
.chip small { margin-inline-start: 6px; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .8); }
.chip[aria-pressed="true"] { background: var(--beam); border-color: var(--beam); color: #fff; font-weight: 700; }

/* نوار روزها */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.day {
  flex: none; width: 74px; padding: 10px 4px 8px; border-radius: 16px; scroll-snap-align: start;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; text-align: center; line-height: 1.35;
}
.day .w { display: block; font-size: 12.5px; color: var(--ink-3); }
.day .d { display: block; font-size: 24px; font-weight: 900; margin: 2px 0; }
.day .m { display: block; font-size: 12px; color: var(--ink-2); }
.day:hover { border-color: var(--beam); }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.day[aria-pressed="true"] .w, .day[aria-pressed="true"] .m { color: inherit; opacity: .75; }
.day:disabled { opacity: .4; cursor: not-allowed; border-style: dashed; }
.day:disabled:hover { border-color: var(--line-strong); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 14px; }
.slot {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 16px; font-weight: 700; cursor: pointer; font-feature-settings: "tnum";
}
.slot:hover { border-color: var(--beam); }
.slot[aria-pressed="true"] { background: var(--beam); border-color: var(--beam); color: #fff; }
.slot:disabled { cursor: not-allowed; color: var(--ink-3); background: var(--sunken); border-color: transparent; text-decoration: line-through; font-weight: 400; }
.slots-head { margin-top: 14px; font-size: 14.5px; color: var(--ink-2); }
.slots-head b { color: var(--ink); }
.slots-head + .slots { margin-top: 10px; }
.slots-note { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.skeleton { height: 44px; border-radius: 12px; background: linear-gradient(90deg, var(--sunken), var(--line), var(--sunken)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field > span em { color: var(--beam); font-style: normal; }
.field small { font-size: 12.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); outline: none; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.8; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--beam); box-shadow: 0 0 0 3px var(--beam-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.ltr { text-align: left; }
.select { appearance: none; padding-inline-start: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23958ea8' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--sunken); }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 10px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(35, 26, 51, .14); }
.seg input:focus-visible + span { outline: 2px solid var(--beam); }
.trap { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error { padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 14.5px; margin: 0 22px 4px; }
.submit-row { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.submit-row .btn { width: 100%; min-height: 54px; font-size: 17px; }
.submit-row small { color: var(--ink-3); font-size: 13px; text-align: center; }

/* خلاصه نوبت (کنار فرم) */
.summary { position: sticky; top: 16px; padding: 20px; }
.summary h3 { font-size: 15px; font-weight: 900; margin-bottom: 12px; }
.summary dl { margin: 0; display: grid; gap: 10px; }
.summary dt { font-size: 12.5px; color: var(--ink-3); }
.summary dd { margin: 0; font-weight: 700; }
.summary dd.empty { font-weight: 400; color: var(--ink-3); }
.summary .contact { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.summary .contact a { text-decoration: none; display: flex; align-items: center; gap: 8px; }
.summary .contact span { display: flex; align-items: flex-start; gap: 8px; }
.summary .contact svg { width: 17px; height: 17px; flex: none; margin-top: 4px; color: var(--ink-3); }

/* نتیجه */
.done { max-width: 560px; margin: 0 auto; padding: 34px 26px; text-align: center; }
.done .tick { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.done .tick svg { width: 32px; height: 32px; }
.done h2 { font-size: 24px; font-weight: 900; }
.done p { color: var(--ink-2); margin-top: 8px; }
.done .when { margin: 22px 0; padding: 16px; border-radius: 16px; background: var(--sunken); font-size: 18px; font-weight: 700; }
.done .code { display: inline-flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.done .code small { color: var(--ink-3); font-size: 13px; }
.done .code b { font-size: 28px; letter-spacing: 6px; font-weight: 900; direction: ltr; font-family: ui-monospace, Consolas, monospace; }
.done .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.closed { max-width: 560px; margin: 0 auto; padding: 30px 26px; text-align: center; }
.closed h2 { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.closed p { color: var(--ink-2); }
.closed .btn { margin-top: 18px; }

footer { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .beams { position: absolute; inset: 0; z-index: -1; opacity: .55; min-height: 0; }
  .top { margin-bottom: 40px; }
  .book { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; display: block; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .hero { padding: 16px 16px 0; }
  .top .call span { display: none; }
  .top .call { width: 44px; padding: 0; }
  .hero .lead { font-size: 16px; }
  .hero .cta-row .btn { flex: 1; }
  .wave { width: calc(100% + 32px); margin: 34px -16px -1px; height: 28px; }
  main { padding: 0 12px 60px; }
  .steps { grid-template-columns: 1fr; border: 0; margin-bottom: 30px; }
  .steps li, .steps li + li { padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); }
  .book-head { padding: 0 4px; }
  .book-head h2 { font-size: 24px; }
  .block { padding: 18px 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .submit-row { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 20px 20px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .error { margin: 0 14px 4px; }
  .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }


.birth-input { display: flex; gap: 8px; }
.birth-input .input { min-width: 0; flex: 1; }
.birth-input .btn { flex: none; padding: 10px 12px; }
.birth-input svg { width: 20px; height: 20px; }
.birth-picker { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-sizing: border-box; border: 1px solid var(--line); border-radius: 20px; padding: 20px; background: var(--surface); color: var(--ink); direction: rtl; font: inherit; }
.birth-picker::backdrop { background: #0008; }
.birth-picker header, .birth-picker nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.birth-picker h2 { font-size: 18px; margin: 0; }
.birth-picker button { font: inherit; cursor: pointer; color: inherit; border: 1px solid var(--line); border-radius: 10px; background: transparent; min-height: 44px; padding: 8px; }
.birth-picker header button { min-width: 44px; }
.birth-picker nav { margin-top: 16px; }
.birth-picker nav button { flex: 1; font-weight: 700; }
.birth-picker p { font-size: 13px; color: var(--ink-3); }
.birth-options { display: grid; gap: 8px; max-height: min(360px, 50dvh); overflow-y: auto; padding: 4px; }
.birth-year { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.birth-month { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.birth-day { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.birth-options button:hover, .birth-options [aria-pressed="true"] { background: var(--line); }
.birth-picker button:focus-visible { outline: 2px solid #d63a70; outline-offset: 2px; }
.birth-picker button:disabled { opacity: .3; cursor: default; }
.birth-weekday { text-align: center; color: var(--ink-3); font-size: 13px; }
