/* Hasti Lab: shared chrome and the three patient flows. Home-page sections live in home.css. */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand: #00b9ed;          /* the flask's liquid in the logo */
  --brand-deep: #0086b0;
  --brand-ink: #035a78;
  --brand-soft: #e2f6fd;
  --glow: #7fe3ff;
  --star: #ffd36b;
  --night: #040a18;           /* the logo's black, a little blue */
  --night-2: #0a1a33;
  --ink: #0b1626;
  --muted: #5b6878;
  --bg: #f4f9fc;
  --surface: #ffffff;
  --line: #dbe7ef;
  --ok: #10915f;
  --ok-soft: #e1f5ec;
  --warn: #9a5a00;
  --warn-soft: #fff3dc;
  --bad: #c0362c;
  --bad-soft: #fdebe9;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(4, 10, 24, .05), 0 14px 34px -14px rgba(4, 10, 24, .18);
  --shadow-lift: 0 2px 4px rgba(4, 10, 24, .06), 0 28px 54px -18px rgba(0, 104, 140, .32);
  --wrap: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 16px; line-height: 1.9;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.has-bar { padding-bottom: 76px; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.35; font-weight: 800; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: 84px; scroll-margin-top: 64px; position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-deep); font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 10px currentColor; }
.section h2 { font-size: clamp(26px, 3.4vw, 40px); margin-bottom: 12px; }
.lead { color: var(--muted); max-width: 60ch; }

.demo-banner { background: var(--night); color: #cfeffa; font-size: 13px; text-align: center; padding: 6px 16px; }
.demo-banner a { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(244, 249, 252, .82);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s, background .3s;
}
.site-header.is-stuck { border-color: var(--line); box-shadow: 0 10px 28px -20px rgba(4, 10, 24, .45); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 74px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; }
.logo img { width: 48px; height: 40px; object-fit: contain; transition: transform .6s var(--spring); }
.logo:hover img { transform: rotate(-12deg) scale(1.06); }
.logo small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); line-height: 1.4; }
.nav { display: flex; gap: 2px; margin-inline-start: auto; }
.nav a { position: relative; padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--muted); transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--brand-soft); }
.header-cta { display: flex; gap: 10px; align-items: center; }

/* Buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; isolation: isolate;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, border-color .25s, color .25s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--night); color: #fff; box-shadow: 0 12px 26px -14px rgba(4, 10, 24, .8); }
.btn-primary:hover { background: var(--night-2); box-shadow: 0 16px 30px -14px rgba(0, 134, 176, .7); }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-accent { background: var(--brand); color: var(--night); font-size: 17px; min-height: 56px; box-shadow: 0 16px 34px -14px rgba(0, 185, 237, .9); }
.btn-accent::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(120%); transition: transform .8s var(--ease); }
.btn-accent:hover { transform: translateY(-2px); }
.btn-accent:hover::after { transform: translateX(-120%); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.link { color: var(--brand-deep); font-weight: 800; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.is-open .dot { background: #2fe39a; box-shadow: 0 0 0 4px rgba(47, 227, 154, .22); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 8px rgba(47, 227, 154, .08); } }

/* Footer */
.site-footer { position: relative; overflow: hidden; background: var(--night); color: rgba(220, 240, 250, .72); padding-block: 44px 40px; font-size: 14px; margin-top: 84px; }
.site-footer::before { content: ""; position: absolute; inset-inline-end: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; border: 1px dashed rgba(0, 185, 237, .25); }
.site-footer .wrap { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.site-footer a { color: #fff; }
.foot-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; }
.foot-brand img { width: 44px; height: 36px; object-fit: contain; filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(0, 185, 237, .5)); }

/* Mobile action bar */
.bar { display: none; }

/* Reveal and word motion. Persian letters join, so the unit is the word. */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.words .w { display: inline-block; opacity: 0; transform: translateY(.6em) scale(.96); filter: blur(8px); transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease); }
.words.in .w { opacity: 1; transform: none; filter: none; }
.rotate { display: block; min-height: 1.35em; opacity: 0; transform: translateY(.4em); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.words.in .rotate { opacity: 1; transform: none; }
.words.in .rotate.out { opacity: 0; transform: translateY(-.4em); }

/* ---------- Journey steps (hero phone and tracking page) ---------- */
.journey-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.journey-head b { font-size: 15px; }
.journey-head span { font-size: 12.5px; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps li { position: relative; display: flex; gap: 14px; padding-block: 9px; color: var(--muted); transition: color .4s; }
.steps li::before {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; margin-top: 4px;
  border: 2px solid var(--line); background: var(--surface); position: relative; z-index: 1;
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.steps li::after { content: ""; position: absolute; inset-inline-start: 10px; top: 30px; bottom: -12px; width: 2px; background: var(--line); transition: background .4s; }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.3l3 3 6-6.3' fill='none' stroke='%23040a18' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100%; border-color: var(--brand); }
.steps li.done::after { background: var(--brand); }
.steps li.now { color: var(--ink); font-weight: 800; }
.steps li.now::before { border-color: var(--brand); box-shadow: 0 0 0 6px var(--brand-soft); animation: pulse 1.8s infinite; }
.steps small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px rgba(0, 185, 237, .12); } }

/* The collector on the tracking page: photo above the name, an orbit while on the way */
.collector {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  margin: 0 0 18px; padding: 24px 16px 16px; border-radius: var(--radius); overflow: hidden; color: #fff;
  background: radial-gradient(260px 160px at 85% 0%, rgba(0, 185, 237, .4), transparent 70%), linear-gradient(160deg, var(--night-2), var(--night));
}
.collector-face { position: relative; width: 96px; height: 96px; margin-bottom: 10px; }
.collector-face img, .collector-face span {
  position: absolute; inset: 8px; width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  border: 3px solid #fff; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5);
}
.collector-face span { display: grid; place-items: center; background: var(--brand); color: var(--night); font-size: 34px; font-weight: 900; }
.collector-face span:empty { display: none; }
.collector-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(127, 227, 255, .5); }
.collector-ring::after { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.collector small { font-size: 12px; color: rgba(255, 255, 255, .72); }
.collector b { font-size: 18px; line-height: 1.6; }
.collector-state { margin-top: 6px; padding: 2px 12px; border-radius: 99px; font-size: 12.5px; background: rgba(255, 255, 255, .14); }
.collector-road { display: none; width: 100%; max-width: 240px; height: 24px; margin-top: 8px; }
.collector-road path { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 2; stroke-dasharray: 6 6; }
.collector-road circle { fill: var(--brand); offset-path: path("M8 16 C 60 4, 100 22, 150 12 S 220 6, 232 14"); animation: road 4s var(--ease) infinite; }
.collector.moving .collector-ring { animation: spin 3s linear infinite; }
.collector.moving .collector-road { display: block; }
.collector.moving .collector-state { background: var(--brand); color: var(--night); font-weight: 800; }
.collector.enter .collector-face { animation: face-in .7s var(--ease) both; }
@supports not (offset-path: path("M0 0")) { .collector-road circle { display: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes road { from { offset-distance: 100%; } to { offset-distance: 0%; } }
@keyframes face-in { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Flow pages (request / track / results) ---------- */
.flow { position: relative; padding-block: 44px 24px; }
.flow::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 300px; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 240px at 80% 0%, rgba(0, 185, 237, .16), transparent 70%),
              radial-gradient(1px 1px at 20% 30%, var(--brand) 99%, transparent) 0 0 / 60px 60px;
  -webkit-mask: linear-gradient(#000, transparent); mask: linear-gradient(#000, transparent);
}
.flow-box { max-width: 680px; margin-inline: auto; }
.flow h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 6px; }
.flow .lead { margin-bottom: 26px; }
.progress { display: flex; gap: 8px; margin-bottom: 22px; }
.progress i { flex: 1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; position: relative; }
.progress i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--glow), var(--brand)); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.progress i.on::after { transform: scaleX(1); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.panel h2 { font-size: 20px; margin-bottom: 18px; }
.panel[hidden] { display: none; }
.panel.enter { animation: swap .4s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field legend, fieldset legend { font-weight: 700; font-size: 14.5px; }
.field input, .field select, .field textarea {
  min-height: 50px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--bg); width: 100%; font-size: 16px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft); }
.hint { font-size: 13px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--bad); font-weight: 700; }
.field.bad input { border-color: var(--bad); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 6px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px 12px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); font-weight: 700; font-size: 14.5px;
  transition: border-color .2s, background .2s, color .2s, transform .2s var(--ease);
}
.choice:hover span { border-color: var(--glow); }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); transform: translateY(-2px); box-shadow: 0 8px 18px -12px rgba(0, 134, 176, .7); }
.choice input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.choice input:disabled + span { opacity: .45; text-decoration: line-through; }
.fold[hidden] { display: none; }
.fold { padding: 16px; border-radius: var(--radius-sm); background: var(--bg); border: 1.5px dashed var(--glow); margin-bottom: 16px; }
.pin-box {
  height: 180px; border-radius: var(--radius-sm); border: 1.5px dashed var(--glow); margin-bottom: 16px;
  background: linear-gradient(0deg, rgba(0, 185, 237, .1) 1px, transparent 1px) 0 0 / 28px 28px,
              linear-gradient(90deg, rgba(0, 185, 237, .1) 1px, transparent 1px) 0 0 / 28px 28px, var(--bg);
  display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; padding: 16px;
}
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.flow-box .nav-row h2 { margin: 0; }
.summary { display: grid; gap: 10px; margin-bottom: 18px; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); }
.summary span { color: var(--muted); flex: none; }
.summary b { text-align: end; font-weight: 700; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-soft); border: 1px solid #b8e9f8; font-size: 14px; margin-bottom: 16px; }
.note[hidden] { display: none; }
.note-err { background: var(--bad-soft); border-color: #f5c6c1; color: #8a231b; font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; margin-bottom: 16px; }
.check input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--brand-deep); flex: none; }
.done-mark { width: 78px; height: 78px; border-radius: 50%; background: var(--brand); color: var(--night); display: grid; place-items: center; margin: 0 auto 16px; animation: pop .6s var(--spring); box-shadow: 0 0 0 10px var(--brand-soft); }
.done-mark svg { width: 38px; height: 38px; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.code { display: inline-block; direction: ltr; font-weight: 900; font-size: 28px; letter-spacing: .14em; padding: 8px 22px; border-radius: var(--radius-sm); background: var(--night); color: var(--brand); margin-block: 12px; }
.otp { direction: ltr; text-align: center; letter-spacing: .5em; font-size: 24px !important; font-weight: 800; }
.otp-box { padding: 20px; margin-bottom: 16px; border-radius: var(--radius-sm); background: var(--bg); border: 1.5px solid var(--glow); display: grid; gap: 12px; justify-items: start; }
.otp-box[hidden], .otp-box [hidden] { display: none; }
.otp-box h3 { font-size: 18px; }
.otp-box .choices, .otp-box .field { width: 100%; margin: 0; }
.otp-steps { margin: 12px 0 0; padding-inline-start: 1.3em; font-size: 14.5px; color: var(--muted); }
.otp-wait { animation: fade 1.6s ease-in-out infinite; }
@keyframes fade { 50% { opacity: .45; } }
.result-list { display: grid; gap: 12px; }
.result-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); }
.result-item > div { flex: 1 1 180px; }
.result-item small { display: block; color: var(--muted); font-size: 13px; }
.badge { padding: 2px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.wait { background: var(--warn-soft); color: var(--warn); }
.badge.stop { background: #eceef2; color: #555b66; }
.lookup-door { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; padding: 14px 18px; border-radius: var(--radius-sm); border: 1.5px dashed var(--glow); background: var(--surface); font-size: 14.5px; color: var(--muted); }
.lookup-door[hidden] { display: none; }
.lookup-timer { margin-top: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .header-cta { margin-inline-start: auto; }
}
@media (max-width: 640px) {
  .section { padding-block: 60px; }
  .grid-2 { grid-template-columns: 1fr; }
  .header-cta .btn-ghost { display: none; }
  .logo small { display: none; }
  .panel { padding: 20px; }
  .flow .nav-row > .btn { flex: 1; padding-inline: 12px; }
  .bar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
    background: rgba(4, 10, 24, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(0, 185, 237, .25);
  }
  .bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; font-size: 12px; font-weight: 700; color: rgba(220, 240, 250, .7); }
  .bar a svg { width: 22px; height: 22px; }
  .bar a.on { color: var(--night); background: var(--brand); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
