:root {
  /* Bianca logo palette: navy letterform, royal blue, sky-blue air swoosh. */
  --bg: #f3f7fc;
  --surface: #ffffff;
  --text: #102344;
  --muted: #5a6b85;
  --border: #d9e3f1;
  --brand-dark: #0f2f6e;
  --primary: #1a56b8;
  --primary-hover: #154a9f;
  --primary-soft: #e6effb;
  --primary-ink: #ffffff;
  --accent: #5bc0f5;
  --free: #1f9d55;
  --partial: #d99a06;
  --full: #d64545;
  --past: #b8c4cb;
  --danger-bg: #fdecec;
  --danger-ink: #9b1c1c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(19, 38, 47, 0.04), 0 6px 20px rgba(19, 38, 47, 0.06);
  --focus: 0 0 0 3px rgba(26, 86, 184, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1428;
    --surface: #111f3a;
    --text: #e7eefa;
    --muted: #9fb0cc;
    --border: #22345a;
    --brand-dark: #0b2457;
    --primary: #5bb4f2;
    --primary-hover: #7cc7f5;
    --primary-soft: #16305c;
    --primary-ink: #061226;
    --danger-bg: #3a1d1d;
    --danger-ink: #ffb4b4;
    --shadow: none;
    --focus: 0 0 0 3px rgba(91, 180, 242, 0.4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  line-height: 1.7;
  font-size: 16px;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

h1, h2, h3 { line-height: 1.3; }

/* ---------- Header & hero ---------- */

.site-header {
  background: var(--brand-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--brand-dark);
  font-size: 1.2rem;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
}
.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.call-btn:hover { background: rgba(255, 255, 255, 0.22); }

.hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 32px 0 28px;
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4vw, 2rem);
}
.hero-sub {
  margin: 0 0 14px;
  opacity: 0.9;
  max-width: 560px;
}
.trust {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trust li {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.88rem;
}

/* ---------- Main ---------- */

main { padding: 0 0 32px; position: relative; }

.progress {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-text {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 0 0 16px;
  min-width: 0;
}
fieldset.card { border-width: 1px; }
legend {
  font-weight: 800;
  padding: 0 8px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
/* Address numbers are short, so they sit two per row even on phones. */
.address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.address-grid .field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.optional { font-style: normal; font-weight: 400; color: var(--muted); font-size: 0.85rem; }

input, textarea, button { font: inherit; }
input, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
button:focus-visible, a:focus-visible, .slot:focus-visible, .day:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--full); }

.input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.input-row input { flex: 1 1 200px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, transform 0.05s;
}
.btn:hover { background: var(--primary-soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { border-color: var(--border); color: var(--text); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn.icon { min-width: 44px; padding: 0; font-size: 1.3rem; line-height: 1; }
.btn.xl { min-height: 56px; font-size: 1.1rem; box-shadow: 0 8px 20px rgba(26, 86, 184, 0.25); }
.btn.block { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hint { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.hint.center, .center { text-align: center; }
.error { display: block; color: var(--full); font-size: 0.88rem; margin-top: 6px; }
.error:empty { display: none; }

.alert {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-weight: 600;
}

/* ---------- AC types ---------- */

.ac-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .ac-grid { grid-template-columns: repeat(4, 1fr); } }
.ac-option {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 8px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
}
.ac-option:hover { border-color: var(--primary); }
.ac-option:active { transform: scale(0.98); }
.ac-option input {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.ac-option:focus-within { box-shadow: var(--focus); }
.ac-option .ac-icon { display: flex; justify-content: center; margin-bottom: 8px; color: var(--muted); }
.ac-option .ac-icon svg { width: 52px; height: 52px; }
.ac-option.selected .ac-icon { color: var(--primary); }
.ac-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* ---------- Calendar ---------- */

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.calendar-head strong { font-size: 1.05rem; }
.legend-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; }
.dot.free { background: var(--free); }
.dot.partial { background: var(--partial); }
.dot.full { background: var(--full); }

/* minmax(0, 1fr): columns may shrink below a day's min-height, so the week fits on narrow phones. */
.weekdays, .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 400px) { .weekdays, .calendar { gap: 4px; } }
.weekdays { font-size: 0.78rem; color: var(--muted); text-align: center; margin-bottom: 6px; font-weight: 600; }
.day {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  position: relative;
  min-height: 44px;
  transition: border-color 0.15s, transform 0.1s;
}
.day:hover:not(:disabled) { border-color: var(--primary); }
.day .bar { position: absolute; bottom: 6px; left: 25%; right: 25%; height: 4px; border-radius: 2px; }
.day.free .bar { background: var(--free); }
.day.partial .bar { background: var(--partial); }
.day.full .bar { background: var(--full); }
.day.past { color: var(--muted); opacity: 0.5; cursor: not-allowed; background: transparent; }
.day.full { cursor: not-allowed; opacity: 0.6; }
.day.empty { visibility: hidden; }
.day.selected { border: 2px solid var(--primary); background: var(--primary-soft); color: var(--primary); }
.day.today::after {
  content: "";
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.subhead { font-size: 1rem; margin: 18px 0 10px; }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 6px;
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  text-align: center;
  min-height: 52px;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.slot:hover:not(:disabled) { border-color: var(--primary); }
.slot.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
}
.slot:disabled { text-decoration: line-through; color: var(--muted); cursor: not-allowed; background: var(--bg); opacity: 0.7; }

/* ---------- CAPTCHA ---------- */

.captcha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.captcha-label { color: var(--muted); flex: 1 1 100%; }
.captcha-label strong { color: var(--text); }
.captcha input { width: 130px; }

/* ---------- Submit & success ---------- */

#formError { scroll-margin-top: 90px; }

.success { text-align: center; padding: 28px 20px; }
.success h2 { margin: 6px 0 10px; color: var(--free); }
.check {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--free);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
}
.success dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  text-align: start;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 16px 0;
}
.success dt { color: var(--muted); }
.success dd { margin: 0; font-weight: 600; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 20px 0;
  font-size: 0.92rem;
}
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-link { color: var(--accent); text-decoration: none; }
.footer-legal { margin: 12px auto 0; font-size: 0.78rem; opacity: 0.75; text-align: center; }

/* ---------- Legal pages ---------- */

.legal { padding-top: 24px; padding-bottom: 32px; }
.legal h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--primary); }
.legal h2 { margin: 22px 0 6px; font-size: 1.1rem; }
.legal ul { padding-inline-start: 22px; margin: 6px 0; }
.legal a { color: var(--primary); }
.footer-link:hover { text-decoration: underline; }

/* ---------- AC quantity cards (multi-select) ---------- */

.ac-card { display: flex; flex-direction: column; gap: 8px; }
button.ac-option {
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: var(--text);
}
.qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
}
.qty-value { min-width: 28px; text-align: center; font-weight: 800; color: var(--primary); }

/* ---------- Map picker ---------- */

.map-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.coords-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.coords-row input { flex: 1 1 200px; min-width: 0; font-family: monospace; }
.map {
  height: 300px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  overflow: hidden;
  z-index: 0;
}
.map .leaflet-control-attribution { font-size: 0.7rem; }

[hidden] { display: none !important; }

/* ---------- Motion ----------
   One easing family and three durations keep every movement feeling related.
   Enter animations replay automatically when the calendar or slots are re-rendered,
   because replaceChildren inserts fresh nodes. */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur-base: 280ms;
  --dur-slow: 600ms;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes select-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-drift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes sheen {
  from { transform: translateX(-120%) skewX(-20deg); }
  to { transform: translateX(220%) skewX(-20deg); }
}
@keyframes check-in {
  0% { transform: scale(0); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes ring-pulse {
  from { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.45); }
  to { box-shadow: 0 0 0 22px rgba(31, 157, 85, 0); }
}
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Header gains depth once the page scrolls under it. */
.site-header { transition: box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out); }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(15, 47, 110, 0.28); }
.brand-logo { transition: transform var(--dur-base) var(--ease-spring); }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }
.call-btn { transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.call-btn:hover { transform: translateY(-1px); }

/* Hero: slow colour drift plus a staggered entrance for its text. */
.hero {
  background: linear-gradient(120deg, var(--brand-dark) 0%, var(--primary) 55%, #2f86d6 100%);
  background-size: 200% 200%;
  animation: hero-drift 18s ease-in-out infinite;
}
.hero .eyebrow, .hero .hero-title, .hero .hero-sub, .hero .trust li {
  animation: fade-up var(--dur-slow) var(--ease-out) both;
}
.hero .hero-title { animation-delay: 80ms; }
.hero .hero-sub { animation-delay: 160ms; }
.hero .trust li:nth-child(1) { animation-delay: 240ms; }
.hero .trust li:nth-child(2) { animation-delay: 300ms; }
.hero .trust li:nth-child(3) { animation-delay: 360ms; }

/* Cards rise into view as the visitor scrolls (only when JS marks the page, so nothing stays hidden without it). */
.motion .card.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.motion .card.reveal.in-view { opacity: 1; transform: none; }
.card { transition: box-shadow var(--dur-base) var(--ease-out); }
.card:focus-within { box-shadow: 0 1px 2px rgba(15, 47, 110, 0.05), 0 10px 28px rgba(15, 47, 110, 0.1); }

/* Progress bar: smoother fill and a soft glow when complete. */
.progress-bar { transition: width var(--dur-slow) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.progress.done .progress-bar { box-shadow: 0 0 12px rgba(91, 192, 245, 0.7); }

/* Buttons: gentle lift on hover, press-in on click, sheen across the main CTA. */
.btn { transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn.xl { position: relative; overflow: hidden; }
.btn.xl:hover:not(:disabled) { box-shadow: 0 12px 28px rgba(26, 86, 184, 0.35); }
.btn.xl::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%) skewX(-20deg);
  pointer-events: none;
}
.btn.xl:hover:not(:disabled)::after { animation: sheen 900ms var(--ease-out); }

/* AC type cards. */
.ac-option { transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.ac-option:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 47, 110, 0.1); }
.ac-option:active { transform: scale(0.97); }
.ac-option.selected { animation: select-pop var(--dur-base) var(--ease-spring); }
.ac-option .ac-icon { transition: color var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring); }
.ac-option.selected .ac-icon { transform: translateY(-2px) scale(1.06); }
.qty:not([hidden]) { animation: slide-down var(--dur-base) var(--ease-out); }
.qty-value { display: inline-block; transition: transform var(--dur-fast) var(--ease-spring); }

/* Calendar days and time slots cascade in on every render; --i is set per cell from app.js. */
.calendar .day { animation: pop-in var(--dur-base) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 12ms); }
.day { transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.day:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(15, 47, 110, 0.1); }
.day.selected { animation: select-pop var(--dur-base) var(--ease-spring); }
.slot-grid .slot { animation: fade-up var(--dur-base) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.slot { transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.slot:hover:not(:disabled) { transform: translateY(-2px); }
.slot.selected { animation: select-pop var(--dur-base) var(--ease-spring); }

/* Month change: the grid slides from the side the visitor moved toward (set by loadMonth in app.js). */
.calendar.slide-from-left { animation: cal-slide-left var(--dur-base) var(--ease-out); }
.calendar.slide-from-right { animation: cal-slide-right var(--dur-base) var(--ease-out); }
@keyframes cal-slide-left {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: none; }
}
@keyframes cal-slide-right {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}

/* Coordinates row and copy feedback. */
.coords-row input { transition: background var(--dur-base) var(--ease-out); }

/* Form error draws the eye with a short shake. */
.alert:not([hidden]) { animation: fade-up var(--dur-base) var(--ease-out); }
.alert.shake { animation: shake 420ms var(--ease-out); }

/* Success: the check springs in with a ring, then the details follow. */
.success:not([hidden]) .check { animation: check-in 520ms var(--ease-spring) both, ring-pulse 1.2s var(--ease-out) 450ms 2; }
.success:not([hidden]) > :not(.check) { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 300ms; }
.success:not([hidden]) > h2 { animation-delay: 220ms; }

.footer-link { transition: color var(--dur-fast) var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition: none !important;
  }
  .motion .card.reveal { opacity: 1; transform: none; }
}
