/* Nabd Clinic & Academy: demo stylesheet. Mobile-first, logical properties for RTL. */

:root {
  --ink: #0c2b33;
  --teal-900: #0a3a40;
  --teal: #0d6b67;
  --teal-600: #0a5955;
  --teal-300: #7cc4b5;
  --mint: #dff2ea;
  --mint-50: #f1f9f5;
  --sand: #f7f2ea;
  --sand-200: #ece2d1;
  --paper: #fbfaf7;
  --white: #ffffff;
  --line: #d8e4df;
  --text: #10262c;
  --muted: #4a6067;
  --gold: #a87322;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --ok: #146c43;
  --ok-bg: #e3f4ea;
  --warn: #8a5a00;
  --warn-bg: #fdf1d8;
  --radius: 22px;
  --radius-s: 14px;
  --shadow: 0 1px 2px rgba(12, 43, 51, .06), 0 10px 30px -12px rgba(12, 43, 51, .18);
  --shadow-l: 0 2px 4px rgba(12, 43, 51, .05), 0 30px 60px -24px rgba(12, 43, 51, .30);
  --font: "Manrope", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Manrope", system-ui, sans-serif;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--teal);
  color-scheme: light;
}

/* Language visibility (shared convention) */
html[lang="en"] [lang="ar"]:not(html):not([data-keep]):not([data-lang-toggle]),
html[lang="ar"] [lang="en"]:not(html):not([data-keep]):not([data-lang-toggle]) { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.75; }
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-600); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.02em; font-weight: 800; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; line-height: 1.35; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 6.4vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); }
h3 { font-size: 1.2rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
::selection { background: var(--mint); color: var(--ink); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 720px) { .container { padding-inline: 32px; } }

.ic { width: 1.25em; height: 1.25em; flex: none; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 250, 247, .86);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(12, 43, 51, .4); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.02em; margin-inline-end: auto; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(140deg, var(--teal) 0%, var(--teal-900) 100%); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -6px rgba(13, 107, 103, .7); }
.brand-mark .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-size: 1.05rem; }
.brand-text small { font-weight: 600; font-size: .72rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
html[lang="ar"] .brand-text small { text-transform: none; letter-spacing: 0; font-size: .78rem; }

.site-nav { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:hover { background: var(--mint-50); color: var(--teal-600); }
.site-nav a[aria-current="page"] { background: var(--mint); color: var(--teal-900); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-toggle {
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; cursor: pointer; min-height: 40px;
}
.lang-toggle[lang="ar"] { font-family: var(--font-ar); }
.lang-toggle:hover { border-color: var(--teal-300); }
.nav-toggle {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--white); cursor: pointer; color: var(--ink);
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s; content: ""; }
.nav-toggle .bars::before { position: absolute; top: -6px; }
.nav-toggle .bars::after { position: absolute; top: 6px; }
.nav-open .nav-toggle .bars { background: transparent; }
.nav-open .nav-toggle .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle .bars::after { transform: translateY(-6px) rotate(-45deg); }
.header-cta { display: none; }

@media (max-width: 959.98px) {
  .nav-open .site-nav {
    display: block; position: absolute; inset-inline: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px rgba(12, 43, 51, .35);
    padding: 8px 20px 20px;
  }
  .nav-open .site-nav ul { flex-direction: column; }
  .nav-open .site-nav a { padding: 12px 14px; border-radius: 12px; font-size: 1.05rem; }
}
@media (min-width: 960px) {
  .site-nav { display: block; }
  .nav-toggle { display: none; }
  .header-cta { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer; line-height: 1.2;
  transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 20px -10px rgba(13, 107, 103, .9); }
.btn-primary:hover { background: var(--teal-600); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #12404a; color: #fff; }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal-300); color: var(--teal-600); }
.btn-light { background: #fff; color: var(--teal-900); }
.btn-light:hover { background: var(--mint); color: var(--teal-900); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .ic { width: 1.1em; height: 1.1em; }

/* ---------- Generic ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .92rem; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--muted); max-width: 60ch; }
.section { padding-block: clamp(56px, 9vw, 104px); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 36px; }
.section-head > div { max-width: 640px; }
.section-head p { color: var(--muted); margin: 0; }
.bg-mint { background: var(--mint-50); }
.bg-sand { background: var(--sand); }
.muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--mint); color: var(--teal-900); white-space: nowrap; }
.pill-sand { background: var(--sand-200); color: #5a4523; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-ink { background: var(--ink); color: #fff; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 999.98px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.demo-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s);
  background: var(--warn-bg); color: #5c3c00; font-size: .92rem; border: 1px solid #f1d9a6;
}
.demo-note .ic { color: var(--warn); margin-top: 3px; }
.demo-tag { display: inline-block; background: #5c3c00; color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .1em; padding: 3px 8px; border-radius: 6px; vertical-align: middle; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: 36px 64px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -30% auto auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(124, 196, 181, .35), rgba(124, 196, 181, 0)); pointer-events: none;
}
[dir="rtl"] .hero::before { inset: -20% auto auto -30%; }
.hero-grid { position: relative; display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { padding-block: 56px 96px; } .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.hero h1 { margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--teal); position: relative; white-space: nowrap; }
html[lang="ar"] .hero h1 em { white-space: normal; }
.hero .lead { margin-bottom: 28px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 0; list-style: none; color: var(--muted); font-size: .92rem; font-weight: 600; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust .ic { color: var(--teal); }

.hero-visual { position: relative; min-height: 400px; }
.hero-art { position: absolute; inset: 0; border-radius: 32px; overflow: hidden; background: linear-gradient(155deg, #0f5d5b 0%, #0a3a40 70%, #0c2b33 100%); box-shadow: var(--shadow-l); }
.hero-art svg { width: 100%; height: 100%; }
.float {
  position: absolute; background: rgba(255, 255, 255, .97); border-radius: 18px; box-shadow: var(--shadow-l);
  padding: 14px 16px; font-size: .9rem; border: 1px solid rgba(255, 255, 255, .8);
}
.float-booking { inset-inline-start: 14px; top: 24px; width: min(270px, 78%); animation: bob 7s ease-in-out infinite; }
.float-pay { inset-inline-end: 14px; bottom: 26px; width: min(250px, 72%); animation: bob 8s ease-in-out -3s infinite; }
.float-course { inset-inline-end: 22px; top: 35%; width: 200px; display: none; animation: bob 9s ease-in-out -5s infinite; }
@media (min-width: 520px) { .float-course { display: block; } .hero-visual { min-height: 460px; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.float h4 { font-size: .95rem; margin: 0 0 2px; }
.float .small { font-size: .8rem; color: var(--muted); }
.float-row { display: flex; align-items: center; gap: 10px; }
.float .avatar { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: none; }
.slots-mini { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.slots-mini span { padding: 4px 9px; border-radius: 8px; background: var(--mint-50); border: 1px solid var(--line); font-size: .78rem; font-weight: 700; color: var(--teal-900); }
.slots-mini span.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.pay-line { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; }
.pay-line strong { color: var(--ink); }
.pay-badges { display: flex; gap: 6px; margin-top: 10px; }
.paymark { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 7px; font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.paymark-knet { background: #eef3f8; color: #12355b; border: 1px solid #c9d7e6; }
.paymark-apple { background: #111; color: #fff; }
.progress { height: 6px; border-radius: 6px; background: var(--mint); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--teal); border-radius: inherit; }

/* ---------- How it works ---------- */
.steps-strip { display: grid; gap: 14px; counter-reset: s; }
@media (min-width: 760px) { .steps-strip { grid-template-columns: repeat(3, 1fr); } }
.step-card { position: relative; padding: 22px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.step-card .num { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); color: var(--teal-900); font-weight: 800; margin-bottom: 14px; }
.step-card h3 { margin-bottom: 6px; }
.step-card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Departments ---------- */
.dept-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.dept-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); border-color: var(--teal-300); }
.dept-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--ink); }
.dept-icon .ic { width: 28px; height: 28px; }
.dept-card h3 { margin: 6px 0 0; }
.dept-card p { color: var(--muted); font-size: .95rem; margin: 0; flex: 1; }
.dept-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; margin-top: 4px; border-top: 1px dashed var(--line); font-size: .9rem; }
.dept-meta a { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.dept-meta a:hover { text-decoration: underline; }

/* ---------- Doctors ---------- */
.doctor-scroll { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.doc-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.doc-card .avatar { width: 100%; height: auto; aspect-ratio: 5 / 4; }
.doc-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.doc-card h3 { margin: 0; font-size: 1.08rem; }
.doc-card .role { color: var(--teal); font-weight: 700; font-size: .9rem; }
.doc-card .meta { color: var(--muted); font-size: .85rem; }
.doc-card .btn { margin-top: 10px; align-self: flex-start; }

/* ---------- Courses ---------- */
.course-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.course-card:hover { box-shadow: var(--shadow-l); transform: translateY(-2px); }
.course-art { position: relative; height: 128px; overflow: hidden; }
.course-art svg { width: 100%; height: 100%; }
.course-art .pill { position: absolute; top: 12px; inset-inline-start: 12px; background: rgba(255, 255, 255, .94); }
.course-art .fmt { position: absolute; top: 12px; inset-inline-end: 12px; }
.course-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { margin: 0; font-size: 1.12rem; }
.course-body p { margin: 0; color: var(--muted); font-size: .93rem; }
.course-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.course-facts span { display: inline-flex; align-items: center; gap: 6px; }
.course-facts .ic { color: var(--teal); width: 1.05em; height: 1.05em; }
.course-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.price { font-weight: 800; color: var(--ink); font-size: 1.1rem; white-space: nowrap; }
.price small { font-weight: 600; color: var(--muted); font-size: .78rem; }
.seats { font-size: .8rem; color: var(--muted); }
.seats.low { color: var(--danger); font-weight: 700; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--white); color: var(--text); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; cursor: pointer; min-height: 40px; }
.chip:hover { border-color: var(--teal-300); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding-inline-start: 42px !important; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--white); }

/* ---------- Payments band ---------- */
.band { border-radius: 32px; padding: clamp(28px, 5vw, 56px); background: linear-gradient(140deg, var(--teal-900), var(--ink)); color: #e6f2ef; position: relative; overflow: hidden; }
.band h2, .band h3 { color: #fff; }
.band p { color: #c4dcd7; }
.band-grid { display: grid; gap: 28px; position: relative; }
@media (min-width: 900px) { .band-grid { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.band-points { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0; }
.band-points li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.band-points .ic { color: var(--teal-300); margin-top: 3px; }
.band-points strong { color: #fff; display: block; }
.band-points span { color: #c4dcd7; font-size: .93rem; }
.band-deco { position: absolute; inset-inline-end: -80px; bottom: -120px; width: 380px; opacity: .14; color: #fff; }

/* ---------- Testimonials ---------- */
.quote { padding: 26px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; margin: 0; }
.quote .stars { display: flex; gap: 2px; color: var(--gold); }
.quote .stars .ic { width: 18px; height: 18px; fill: currentColor; }
.quote blockquote { margin: 0; font-size: 1.02rem; color: var(--text); }
.quote figcaption { font-size: .88rem; color: var(--muted); }
.quote figcaption strong { color: var(--ink); display: block; }

/* ---------- Visit ---------- */
.visit-grid { display: grid; gap: 22px; }
@media (min-width: 900px) { .visit-grid { grid-template-columns: 1fr 1.15fr; } }
.info-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; }
.info-list .ic { width: 22px; height: 22px; color: var(--teal); margin-top: 2px; }
.info-list strong { display: block; color: var(--ink); }
.hours { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hours th, .hours td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: start; }
.hours td { text-align: end; color: var(--muted); }
.hours tr.today th, .hours tr.today td { color: var(--teal-900); font-weight: 800; }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #e9f1ed; min-height: 300px; position: relative; }
.map svg { width: 100%; height: 100%; min-height: 300px; }
.map-label { position: absolute; inset-inline-start: 16px; bottom: 16px; background: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .88rem; }
.map-label strong { display: block; color: var(--ink); }

/* ---------- CTA + footer ---------- */
.cta { text-align: center; padding: clamp(40px, 6vw, 64px) 22px; border-radius: 32px; background: var(--mint); }
.cta h2 { margin-bottom: 10px; }
.cta p { color: var(--muted); margin-inline: auto; max-width: 52ch; }
.cta .hero-ctas { justify-content: center; margin: 24px 0 0; }
.site-footer { background: var(--ink); color: #c8dbd7; padding: 56px 0 96px; margin-top: 0; font-size: .94rem; }
.site-footer a { color: #e6f2ef; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer .brand-text small { color: #9fbdb7; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: .85rem; color: #9fbdb7; }

/* ---------- RetainrWorks badge ---------- */
.rw-badge {
  position: fixed; z-index: 60; bottom: 12px; inset-inline-start: 12px;
  max-width: calc(100vw - 24px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; font-size: .74rem; font-weight: 700; line-height: 1.3;
  background: rgba(12, 43, 51, .9); color: #fff; text-decoration: none; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.rw-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal-300); flex: none; }
.rw-badge:hover, .rw-badge:focus-visible { background: var(--ink); color: #fff; text-decoration: underline; }

/* ---------- Page header ---------- */
.page-hero { padding-block: 40px 28px; background: linear-gradient(180deg, var(--mint-50), rgba(241, 249, 245, 0)); }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 10px; }
.page-hero .lead { margin: 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field .label, fieldset legend { font-weight: 700; font-size: .94rem; color: var(--ink); }
.field .hint { font-size: .84rem; color: var(--muted); margin: 0; }
.optional { font-weight: 500; color: var(--muted); font-size: .85rem; }
input[type="text"], input[type="tel"], input[type="email"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid #c3d4cf; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #9dbbb4; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 107, 103, .22); border-radius: 12px; }
[aria-invalid="true"]:not([type="radio"]):not([type="checkbox"]) { border-color: var(--danger) !important; background: #fffafa; }
.field-error { color: var(--danger); font-size: .86rem; font-weight: 600; margin: 0; display: flex; gap: 6px; align-items: center; }
.field-error::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; flex: none; }
.field-error[hidden] { display: none; }
.prefix-input { display: flex; align-items: stretch; direction: ltr; }
.prefix-input span { display: grid; place-items: center; padding-inline: 12px; border: 1.5px solid #c3d4cf; border-inline-end: 0; border-radius: 12px 0 0 12px; background: var(--mint-50); font-weight: 700; color: var(--teal-900); }
.prefix-input input { border-radius: 0 12px 12px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .94rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); flex: none; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset legend { padding: 0; margin-bottom: 10px; }
.form-row { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--mint-50); border: 1px solid var(--line); gap: 4px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--teal-900); box-shadow: 0 1px 4px rgba(12, 43, 51, .15); }
.seg input:focus-visible + span { box-shadow: var(--focus); }

/* Option cards (radio) */
.opt { position: relative; display: block; cursor: pointer; }
.opt > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.opt-body { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px; border: 1.5px solid var(--line); background: #fff; transition: border-color .15s, box-shadow .15s, background .15s; height: 100%; }
.opt:hover .opt-body { border-color: var(--teal-300); }
.opt > input:checked + .opt-body { border-color: var(--teal); background: var(--mint-50); box-shadow: 0 0 0 1px var(--teal) inset; }
.opt > input:focus-visible + .opt-body { box-shadow: var(--focus); }
.opt > input:disabled + .opt-body { opacity: .5; cursor: not-allowed; }
.opt-body .tick { margin-inline-start: auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #b7cbc5; display: grid; place-items: center; color: transparent; flex: none; }
.opt > input:checked + .opt-body .tick { background: var(--teal); border-color: var(--teal); color: #fff; }
.opt-body .tick .ic { width: 14px; height: 14px; stroke-width: 3; }
.opt-body h3, .opt-body strong.t { margin: 0; font-size: 1.02rem; color: var(--ink); display: block; }
.opt-body p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.opt-body .avatar { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; flex: none; }
.opt-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .opt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Day + slot chips */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.day { position: relative; flex: none; scroll-snap-align: start; }
.day input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.day span { display: grid; place-items: center; width: 68px; padding: 10px 4px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; text-align: center; line-height: 1.25; }
.day span b { font-size: 1.3rem; color: var(--ink); }
.day span small { font-size: .74rem; color: var(--muted); font-weight: 700; }
.day input:checked + span { background: var(--ink); border-color: var(--ink); }
.day input:checked + span b, .day input:checked + span small { color: #fff; }
.day input:focus-visible + span { box-shadow: var(--focus); }
.day input:disabled + span { background: repeating-linear-gradient(135deg, #f4f7f6 0 6px, #eef2f1 6px 12px); cursor: not-allowed; }
.day input:disabled + span b, .day input:disabled + span small { color: #8a9b9f; }
.slot-group h4 { font-size: .85rem; color: var(--muted); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .08em; }
html[lang="ar"] .slot-group h4 { text-transform: none; letter-spacing: 0; font-size: .92rem; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.slot span { display: block; text-align: center; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; direction: ltr; }
html[lang="ar"] .slot span { direction: rtl; }
.slot input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.slot input:focus-visible + span { box-shadow: var(--focus); }
.slot input:disabled + span { color: #7d8f93; background: #f2f5f4; text-decoration: line-through; cursor: not-allowed; }

/* ---------- Booking layout ---------- */
.flow { display: grid; gap: 24px; padding-bottom: 80px; }
@media (min-width: 980px) { .flow { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.flow-main { padding: clamp(18px, 3.4vw, 32px); }
.stepper { list-style: none; margin: 0 0 26px; padding: 0; display: flex; gap: 6px; counter-reset: st; }
.stepper li { flex: 1; counter-increment: st; font-size: .76rem; font-weight: 700; color: var(--muted); min-width: 0; }
.stepper li::before { content: ""; display: block; height: 5px; border-radius: 5px; background: var(--line); margin-bottom: 8px; }
.stepper li.done::before { background: var(--teal-300); }
.stepper li[aria-current="step"]::before { background: var(--teal); }
.stepper li[aria-current="step"] { color: var(--teal-900); }
.stepper li span.lbl { display: none; }
@media (min-width: 640px) { .stepper li span.lbl { display: inline; } .stepper li { font-size: .82rem; } }
.stepper li .n { margin-inline-end: 4px; }
.step-title { font-size: clamp(1.35rem, 3vw, 1.7rem); margin-bottom: 6px; }
.step-sub { color: var(--muted); margin-bottom: 22px; }
.step-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.step-actions .spacer { flex: 1; }
.summary { padding: 22px; position: sticky; top: 90px; }
.summary h2 { font-size: 1.15rem; margin-bottom: 14px; }
.summary dl { margin: 0; display: grid; gap: 12px; }
.summary dl div { display: flex; justify-content: space-between; gap: 14px; font-size: .92rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; text-align: end; color: var(--ink); }
.summary .total { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; font-size: 1rem; }
.summary .total dd { font-size: 1.15rem; }
.summary .policy { font-size: .84rem; color: var(--muted); margin: 16px 0 0; padding: 12px; border-radius: 12px; background: var(--mint-50); }
.review { display: grid; gap: 10px; margin-bottom: 18px; }
.review-row { display: flex; gap: 14px; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--mint-50); border: 1px solid var(--line); font-size: .94rem; }
.review-row span:first-child { color: var(--muted); }
.review-row strong { text-align: end; }
.deposit-box { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; background: var(--ink); color: #e6f2ef; margin-bottom: 18px; }
.deposit-box .amt { font-size: 1.6rem; font-weight: 800; color: #fff; white-space: nowrap; }
.deposit-box p { margin: 0; font-size: .9rem; color: #c4dcd7; }

/* ---------- Dialog ---------- */
dialog.sheet {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 26px;
  background: var(--paper); color: var(--text); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .45); overflow: auto;
}
dialog.sheet::backdrop { background: rgba(8, 28, 33, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-head { position: relative; }
.sheet-head .course-art { height: 150px; }
.sheet-close { position: absolute; top: 12px; inset-inline-end: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); display: grid; place-items: center; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); }
.sheet-body { padding: 22px clamp(18px, 4vw, 30px) 28px; }
.sheet-body h2 { font-size: 1.5rem; }
.outcomes { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.outcomes li { display: flex; gap: 10px; align-items: flex-start; }
.outcomes .ic { color: var(--teal); margin-top: 4px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 20px; }
.facts-grid div { padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: .88rem; }
.facts-grid dt { color: var(--muted); font-size: .78rem; }
.facts-grid dd { margin: 0; font-weight: 700; color: var(--ink); }
.reg-form { padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Pay ---------- */
.pay-grid { display: grid; gap: 22px; padding-bottom: 90px; }
@media (min-width: 980px) { .pay-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.method-logo { width: 64px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: .9rem; flex: none; letter-spacing: .02em; }
.method-logo.knet { background: linear-gradient(135deg, #eaf1f8, #d6e3f0); color: #12355b; border: 1px solid #c9d7e6; }
.method-logo.apple { background: #111; color: #fff; }
.apple-btn { background: #000; color: #fff; border-radius: 12px; min-height: 52px; font-size: 1.05rem; }
.apple-btn:hover { background: #222; color: #fff; }
.gateway { border-radius: 24px; overflow: hidden; border: 1px solid #c9d7e6; background: #fff; box-shadow: var(--shadow-l); }
.gateway-head { background: linear-gradient(135deg, #12355b, #1d4f82); color: #fff; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gateway-head strong { font-size: 1.05rem; letter-spacing: .02em; }
.gateway-head .demo-tag { background: #ffd666; color: #3a2a00; }
.gateway-body { padding: 20px; }
.gateway dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 18px; font-size: .92rem; }
.gateway dt { color: var(--muted); }
.gateway dd { margin: 0; font-weight: 700; text-align: end; }
.gateway input[readonly] { background: #f3f6f9; color: #5b6b7a; letter-spacing: .12em; direction: ltr; }
.gateway-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gateway-actions .btn { flex: 1 1 160px; }
.btn-knet { background: #12355b; color: #fff; }
.btn-knet:hover { background: #0d2843; color: #fff; }
.processing { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 20px; text-align: center; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--mint); border-top-color: var(--teal); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ap-sheet { width: min(420px, calc(100vw - 24px)); border-radius: 26px; }
.ap-sheet .sheet-body { padding-top: 26px; }
.ap-line { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .94rem; }
.ap-line span:first-child { color: var(--muted); }
.ap-confirm { display: grid; place-items: center; gap: 8px; padding: 22px 0 6px; text-align: center; color: var(--muted); font-size: .9rem; }
.ap-confirm .side { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(12, 43, 51, .08); } }

.confirm-card { padding: clamp(22px, 4vw, 40px); text-align: center; }
.confirm-icon { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.confirm-icon .ic { width: 38px; height: 38px; stroke-width: 2.4; }
.ref { display: inline-block; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-weight: 700; background: var(--mint); color: var(--teal-900); padding: 6px 12px; border-radius: 10px; letter-spacing: .05em; direction: ltr; }
.confirm-card .review { text-align: start; max-width: 520px; margin: 22px auto; }
.confirm-card .hero-ctas { justify-content: center; margin: 22px 0 0; }

/* ---------- Reception dashboard ---------- */
.dash-body { background: #f3f6f5; }
.staff-bar { background: var(--ink); color: #d6e8e4; font-size: .86rem; }
.staff-bar .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-block: 8px; }
.staff-bar strong { color: #fff; }
.dash-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; justify-content: space-between; padding-block: 28px 18px; }
.dash-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 4px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--teal-900); direction: ltr; display: inline-block; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.stat .k { font-size: .82rem; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat .k .ic { color: var(--teal); }
.stat .v { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; color: var(--ink); line-height: 1.2; margin-top: 4px; }
.stat .s { font-size: .8rem; color: var(--muted); }
.dash-grid { display: grid; gap: 18px; padding-bottom: 90px; }
@media (min-width: 1080px) { .dash-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.1rem; margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafcfb; align-items: center; }
.toolbar select, .toolbar input { min-height: 42px; padding-block: 8px; width: auto; flex: 1 1 160px; }
.toolbar .search { max-width: none; flex: 2 1 220px; }
.appt-list { list-style: none; margin: 0; padding: 0; }
.appt { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.appt:last-child { border-bottom: 0; }
.appt.is-online { background: linear-gradient(90deg, rgba(223, 242, 234, .7), rgba(223, 242, 234, 0)); }
[dir="rtl"] .appt.is-online { background: linear-gradient(270deg, rgba(223, 242, 234, .7), rgba(223, 242, 234, 0)); }
.appt-time { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; font-size: .95rem; line-height: 1.2; }
.appt-time small { display: block; font-weight: 600; color: var(--muted); font-size: .74rem; }
.appt-main { min-width: 0; }
.appt-main strong { color: var(--ink); }
.appt-main .sub { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.appt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.appt-ctrl { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.appt-ctrl select { width: auto; min-height: 38px; padding: 6px 10px; font-size: .88rem; border-radius: 10px; }
@media (min-width: 760px) {
  .appt { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .appt-ctrl { grid-column: auto; justify-content: flex-end; }
}
.now-line { display: flex; align-items: center; gap: 8px; padding: 6px 18px; font-size: .74rem; font-weight: 800; color: var(--danger); text-transform: uppercase; letter-spacing: .08em; }
html[lang="ar"] .now-line { text-transform: none; letter-spacing: 0; }
.now-line::after { content: ""; flex: 1; height: 2px; background: var(--danger); border-radius: 2px; opacity: .6; }
.side-list { list-style: none; margin: 0; padding: 8px 18px 16px; display: grid; gap: 12px; }
.side-list li { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; align-items: center; font-size: .9rem; }
.side-list .avatar { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; grid-row: span 2; }
.side-list strong { color: var(--ink); font-size: .92rem; }
.load { height: 6px; border-radius: 6px; background: var(--mint); overflow: hidden; }
.load span { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.reg-item { display: flex !important; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.reg-item:last-child { border-bottom: 0; }
.reg-item .sub { font-size: .82rem; color: var(--muted); display: block; }
.dash-side { display: grid; gap: 18px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--mint-50); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: #fff; color: var(--teal-900); box-shadow: 0 1px 4px rgba(12, 43, 51, .15); }
.online-note { margin: 0 18px 0; }

/* Utilities added late */
[hidden] { display: none !important; }
.flip-back { transform: scaleX(-1); }
[dir="rtl"] .flip-back { transform: none; }
section[id], [id="main"] { scroll-margin-top: 84px; }
.doc-card > .avatar { width: 100%; height: auto; aspect-ratio: 5 / 4; }
.pay-grid.is-done { grid-template-columns: minmax(0, 1fr); }
.pay-grid.is-done #pay-main { width: 100%; max-width: 780px; margin-inline: auto; }
[dir="ltr"] { unicode-bidi: isolate; }
span[dir="ltr"], strong[dir="ltr"] { white-space: nowrap; }
.demo-note .ic { width: 20px; height: 20px; }
.toolbar .search input { width: 100%; }
.course-art .pill.fmt { inset-inline-start: auto; background: rgba(12, 43, 51, .88); color: #fff; }
.header-actions .header-cta { display: none; }
@media (min-width: 960px) { .header-actions .header-cta { display: inline-flex; } }
