:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17212b;
  --muted: #5f6b77;
  --line: #e2e7ec;
  --brand: #0f766e;
  --brand-soft: #e3f4f2;
  --brand-text: #ffffff;
  --wa: #1fa855;
  --wa-dark: #178a45;
  --warn-bg: #fff6e5;
  --warn-text: #7a4d00;
  --error-bg: #fdecec;
  --error-text: #9b1c1c;
  --ok-bg: #e7f6ec;
  --ok-text: #14632f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418;
    --card: #182026;
    --text: #e8edf1;
    --muted: #9aa7b2;
    --line: #2a353d;
    --brand: #2bb3a6;
    --brand-soft: #16302e;
    --brand-text: #06201d;
    --wa: #25c264;
    --wa-dark: #1fa855;
    --warn-bg: #33270f;
    --warn-text: #f5cf87;
    --error-bg: #3a1a1a;
    --error-text: #f4a9a9;
    --ok-bg: #12301c;
    --ok-text: #9be0b0;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 8px;
  min-height: 70vh;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.profile { display: flex; gap: 14px; align-items: center; }

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
}

.profile h1 { font-size: 21px; margin: 0 0 2px; line-height: 1.3; }
.profile .specialty { color: var(--brand); font-weight: 600; margin: 0; }

.meta { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: 15px; }
.meta a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.bio { margin: 12px 0 0; color: var(--muted); white-space: pre-line; font-size: 15px; }
.quals { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.quals li { display: flex; gap: 8px; align-items: flex-start; background: var(--brand-soft); color: var(--text); border-radius: 10px; padding: 7px 10px; font-size: 14px; line-height: 1.45; }
.qual-icon { flex: none; }

.lang-toggle {
  display: block;
  margin: 0 0 10px auto;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 2px;
}
[dir="rtl"] .lang-toggle { margin: 0 auto 10px 0; }

.step { margin-top: 18px; }
.step:first-child { margin-top: 0; }
.step h2 { font-size: 16px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.step h2 .num {
  display: inline-flex;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  align-items: center; justify-content: center;
}

.options { display: grid; gap: 8px; }

.option {
  width: 100%;
  text-align: start;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.option:hover { border-color: var(--brand); }
.option[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.option .price { color: var(--brand); font-weight: 700; white-space: nowrap; }
.option .sub { color: var(--muted); font-size: 13px; font-weight: 400; display: block; }

.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.day {
  flex: 0 0 auto;
  min-width: 84px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
  scroll-snap-align: start;
}
.day .wd { display: block; font-size: 13px; color: var(--muted); }
.day .dt { display: block; font-weight: 700; }
.day .free { display: block; font-size: 12px; color: var(--brand); }
.day[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.day[aria-pressed="true"] .wd { color: var(--text); }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.time {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  min-height: 44px;
}
.time[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: var(--brand-text); }

label.field { display: block; font-weight: 600; margin-bottom: 6px; }
input.text {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--text);
  min-height: 48px;
}
input.text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; color: var(--muted); font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: 0 0 auto; }

.btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  text-decoration: none;
  min-height: 52px;
  margin-top: 16px;
}
.btn-primary { background: var(--brand); color: var(--brand-text); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; margin-top: 8px; min-height: 40px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 22px; height: 22px; flex: 0 0 auto; }

.summary { list-style: none; margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--bg); display: grid; gap: 4px; font-size: 15px; }
.summary b { font-weight: 600; }

.code {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 4px;
  direction: ltr;
  text-align: center;
  margin: 10px 0 0;
  color: var(--brand);
}
.hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; text-align: center; }
.countdown { text-align: center; font-weight: 700; margin-top: 12px; font-variant-numeric: tabular-nums; }

.notice { border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: 15px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.error { background: var(--error-bg); color: var(--error-text); }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }

.success-mark { font-size: 44px; text-align: center; margin: 0; }
.center { text-align: center; }
h2.title { font-size: 20px; margin: 4px 0 0; text-align: center; }

.empty { color: var(--muted); font-size: 15px; margin: 0; }

.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.inline-loading { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.inline-loading .spinner { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px 28px; }
.noscript { text-align: center; padding: 40px 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
