/* Colors come from config.yaml (branding) via CSS variables set in app.js. */
:root {
  --primary: #1559d6;
  --primary-text: #ffffff;
  --accent: #1f2937;
  --navy: #0b2a5b;
  --primary-soft: color-mix(in srgb, var(--primary) 8%, white);
  --primary-line: color-mix(in srgb, var(--primary) 28%, white);
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #1f2937;
  --muted: #5b6474;
  --border: #e3e8ef;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warn-bg: #fffaeb;
  --warn-text: #93370d;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -6px rgba(16, 24, 40, .10);
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
html[lang="ar"] { --font: "IBM Plex Sans Arabic", "Inter", system-ui, Tahoma, sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
img { max-width: 100%; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, white); outline-offset: 2px; }

.sr-only {
  position: absolute; 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: 8px; top: -60px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip-link:focus { top: 8px; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--border); }
.brand span {
  font-weight: 700; font-size: .95rem; color: var(--accent); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lang-toggle {
  flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 6px 16px; cursor: pointer; font-weight: 600; min-height: 40px; color: var(--accent);
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- hero band ---------- */
.hero-band {
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--primary) 85%, white) 0%, transparent 55%),
    linear-gradient(135deg, var(--navy) 0%, color-mix(in srgb, var(--navy) 50%, var(--primary)) 100%);
  color: #fff;
}
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 28px 16px 72px; }
.hero-inner:empty { padding-bottom: 40px; }
.kicker {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  padding: 3px 12px; border-radius: 999px; margin-bottom: 10px;
}
.hero-inner h1 { margin: 0 0 6px; font-size: 1.65rem; line-height: 1.3; font-weight: 700; }
.hero-inner p { margin: 0 0 16px; color: rgba(255, 255, 255, .85); max-width: 46ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .85rem;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px; padding: 4px 12px; color: #fff;
}
.chip img { width: 18px; height: 18px; border-radius: 4px; }
.chip svg { width: 16px; height: 16px; flex: none; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1080px; margin: -48px auto 0; padding: 0 16px 40px; outline: none; flex: 1; position: relative; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-body { padding: 18px 16px 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
h2 { font-size: 1rem; margin: 0 0 14px; color: var(--accent); font-weight: 700; display: flex; align-items: center; gap: 8px; }
h2 .num {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem;
  background: var(--primary-soft); color: var(--primary); flex: none;
}

/* stepper */
.stepper { display: flex; list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.stepper li {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 6px;
  font-size: .82rem; color: var(--muted); font-weight: 600; position: relative; text-align: center;
}
.stepper li .dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem;
  border: 1.5px solid var(--border); background: var(--surface); flex: none;
}
.stepper li[aria-current="step"] { color: var(--primary); }
.stepper li[aria-current="step"]::after { content: ""; position: absolute; bottom: -1px; inset-inline: 12%; height: 2px; background: var(--primary); }
.stepper li[aria-current="step"] .dot { border-color: var(--primary); color: var(--primary); }
.stepper li.done { color: var(--accent); }
.stepper li.done .dot { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

.grid { display: grid; }
.grid > section { padding: 20px 16px; }
.grid > section + section { border-top: 1px solid var(--border); }

@media (min-width: 860px) {
  .hero-inner { padding: 40px 24px 92px; }
  .hero-inner h1 { font-size: 2.1rem; }
  .container { margin-top: -64px; padding: 0 24px 56px; }
  .grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .grid > section { padding: 26px 28px; }
  .grid > section + section { border-top: 0; border-inline-start: 1px solid var(--border); }
  .stepper li { font-size: .88rem; padding: 14px 8px; }
  .card { padding: 24px 28px; }
  .panel-body { padding: 24px 28px; }
}

.banner { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; font-size: .93rem; border: 1px solid transparent; }
.banner.info { background: var(--primary-soft); color: var(--navy); border-color: var(--primary-line); }
.banner.error { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); border-color: #fedf89; }
.panel > .banner { margin: 14px 16px 0; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.cal-head strong { font-size: 1rem; color: var(--accent); }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--accent);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }
html[dir="rtl"] .icon-btn svg { transform: scaleX(-1); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .74rem; color: var(--muted); padding: 4px 0 6px; font-weight: 600; }
.day {
  aspect-ratio: 1; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-weight: 600; position: relative; padding: 0; font-variant-numeric: tabular-nums; font-size: .95rem;
}
.day.has-slots { background: var(--primary-soft); color: var(--navy); }
.day.has-slots::after {
  content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
  position: absolute; bottom: 5px;
}
.day.has-slots:hover { border-color: var(--primary); }
.day:disabled { color: #a3acb9; cursor: default; font-weight: 400; }
.day.today { box-shadow: inset 0 0 0 1.5px var(--primary-line); }
.day[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--primary) 70%, transparent); }
.day[aria-pressed="true"]::after { background: var(--primary-text); }

.tz-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--border); font-size: .84rem; color: var(--muted);
}
.tz-line svg { width: 15px; height: 15px; vertical-align: -3px; margin-inline-end: 4px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; font-weight: 600; }

/* ---------- time slots ---------- */
.day-title { margin: -6px 0 12px; color: var(--muted); font-size: .92rem; }
.slot-group + .slot-group { margin-top: 14px; }
.slot-group h3 { font-size: .78rem; color: var(--muted); font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 480px) { .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 860px) { .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.slot {
  min-height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; font-size: .93rem; color: var(--accent);
  transition: border-color .15s, color .15s, background .15s;
}
.slot:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.empty svg { width: 40px; height: 40px; color: var(--primary-line); display: block; margin: 0 auto 8px; }

/* ---------- form ---------- */
.selected-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px;
}
.selected-box small { display: block; color: var(--muted); font-size: .78rem; }
.selected-box strong { color: var(--navy); }
.field { margin-bottom: 14px; }
.field label { display: flex; gap: 6px; align-items: baseline; font-weight: 600; margin-bottom: 6px; font-size: .9rem; color: var(--accent); }
.field label .tag { font-weight: 400; color: var(--muted); font-size: .78rem; }
.field label .req { color: var(--danger); }
.field input, .field textarea {
  width: 100%; border: 1px solid #cfd6e0; border-radius: var(--radius-sm); padding: 11px 12px; background: var(--surface);
  min-height: 46px; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
html[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: .84rem; margin-top: 4px; }
.hint { font-size: .83rem; color: var(--warn-text); background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.row-2 { display: grid; gap: 0 12px; }
@media (min-width: 480px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.privacy { font-size: .78rem; color: var(--muted); margin: 10px 0 0; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px;
  border-radius: var(--radius-sm); border: 1px solid var(--primary); background: var(--primary); color: var(--primary-text);
  font-weight: 700; cursor: pointer; text-decoration: none; font-size: 1rem; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--accent); border-color: #cfd6e0; font-weight: 600; }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); filter: none; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #fda29b; font-weight: 600; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- confirmation ---------- */
.result-head { text-align: center; padding: 26px 16px 18px; border-bottom: 1px solid var(--border); }
.check {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
  background: var(--ok-bg); color: var(--ok); box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok-bg) 50%, transparent);
}
.check svg { width: 28px; height: 28px; }
.check.cancelled { background: var(--danger-bg); color: var(--danger); box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger-bg) 50%, transparent); }
.result-head h1 { margin: 0 0 4px; font-size: 1.45rem; color: var(--accent); outline: none; }
.result-head p { margin: 0; color: var(--muted); }
.result-grid { display: grid; }
.result-grid > section { padding: 20px 16px; }
.result-grid > section + section { border-top: 1px solid var(--border); }
@media (min-width: 860px) {
  .result-grid { grid-template-columns: 1fr 1fr; }
  .result-grid > section { padding: 24px 28px; }
  .result-grid > section:nth-child(2) { border-top: 0; border-inline-start: 1px solid var(--border); }
  .result-grid > section.wide { grid-column: 1 / -1; }
}
.summary { width: 100%; border-collapse: collapse; }
.summary th, .summary td { padding: 10px 0; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; font-size: .95rem; }
.summary th { color: var(--muted); font-weight: 500; width: 40%; padding-inline-end: 12px; }
.summary td { font-weight: 600; color: var(--accent); }
.summary tr:last-child th, .summary tr:last-child td { border-bottom: 0; }
.meeting-box { display: flex; gap: 12px; align-items: flex-start; }
.meeting-box > img { width: 42px; height: 42px; flex: none; border-radius: 10px; }
.meeting-box p { margin: 0 0 8px; }
.meeting-link { word-break: break-all; font-size: .85rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 160px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.muted { color: var(--muted); }
.result-notes { padding: 0 16px; }
.result-notes .banner:first-child { margin-top: 16px; }
@media (min-width: 860px) { .result-notes { padding: 0 28px; } }
.after-links { text-align: center; margin: 18px 0 0; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } * { transition: none !important; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 6px 16px;
  justify-content: space-between; font-size: .82rem; color: var(--muted);
}
