:root {
  --bg: #07111c;
  --surface: #0e1d2c;
  --surface-2: #132739;
  --line: #1f3649;
  --text: #eaf2f8;
  --muted: #8ea6ba;
  --accent: #5fd4e6;
  --accent-ink: #032029;
  --ok: #3ecf8e;
  --warn: #f5b84b;
  --danger: #ff7a7a;
  --chrome: linear-gradient(180deg, #ffffff 0%, #d3dee8 42%, #7f95a8 52%, #e9f0f5 100%);
  --radius: 16px;
  --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.6;
  background-image: radial-gradient(120% 60% at 50% -10%, #12324a 0%, transparent 60%);
  background-attachment: fixed; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
h2 { font-size: 22px; margin-bottom: 6px; }
p { margin: 0; }
small { font-size: .78em; font-weight: 500; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
#app.authed main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.page { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.page.narrow { padding-top: 24px; gap: 14px; }

.ic { width: 22px; height: 22px; flex: none; }
.ic.sm { width: 15px; height: 15px; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }

/* ---------- الشعار ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; font-family: "Reem Kufi", var(--font); font-weight: 700; line-height: 1; }
.logo .word { font-size: 30px; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 4px; }
.logo .mirror { transform: scaleY(-1); opacity: .28; margin-top: -2px; -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 70%); mask-image: linear-gradient(to top, #000 0%, transparent 70%); }
.logo.sm .word { font-size: 22px; }
.logo.sm { height: 34px; overflow: hidden; }
.logo.xl .word { font-size: 64px; }

/* ---------- الهيدر والتابات ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.top .wa { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ok); }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 10; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
.tabbar a.on { color: var(--accent); }

/* ---------- الترحيب ---------- */
.welcome { padding: 48px 20px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 100vh; justify-content: center; }
.car-art { width: min(300px, 80vw); height: auto; margin: -8px 0 4px; }
.welcome h1 { font-size: 24px; max-width: 320px; }
.lead { color: var(--accent); font-weight: 500; font-size: 17px; }
.feats { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.feats li { display: flex; align-items: center; gap: 10px; text-align: right; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.feats .ic { color: var(--accent); }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 700; cursor: pointer; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn.block { display: flex; width: 100%; }
.btn.big { padding: 16px; font-size: 17px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn.ghost { background: var(--surface-2); border: 1px solid var(--line); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; cursor: pointer; font-size: 13px; }
.link.danger { color: var(--danger); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; align-self: flex-start; font-size: 14px; }

/* ---------- الحقول ---------- */
.stack { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea, .otp {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 16px; outline: none;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .otp:focus { border-color: var(--accent); }
.phone { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.phone:focus-within { border-color: var(--accent); }
.phone input { border: 0; border-radius: 0; background: transparent; }
.phone b { display: grid; place-items: center; padding: 0 12px; color: var(--muted); border-inline-start: 1px solid var(--line); font-weight: 500; }
.otp { text-align: center; font-size: 28px; letter-spacing: 12px; padding: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo { font-size: 12px; color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 10px; padding: 8px 12px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip.on, .chip:has(input:checked) { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); color: var(--accent); }
.seg { margin: 4px 0; }

/* ---------- الكروت ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { font-size: 20px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 2px 10px; border-radius: 999px; }
.sec { margin-top: 10px; font-size: 15px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.sec i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font-size: 12px; font-weight: 700; }
.hello h2 { font-size: 26px; }

.sub-card { background: linear-gradient(160deg, #143b52 0%, var(--surface) 70%); border-color: #25506a; display: flex; flex-direction: column; gap: 10px; }
.sub-head { display: flex; align-items: center; gap: 10px; }
.credit-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.bar { height: 6px; border-radius: 99px; background: #0a1826; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.promo { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(160deg, #143b52 0%, var(--surface) 70%); border-color: #25506a; }
.promo h3 { font-size: 18px; margin: 6px 0 2px; }
.arrow { transform: scaleX(-1); color: var(--accent); }

.services { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.svc b { font-size: 14px; }
.svc p { flex: 1; font-size: 12px; }
.svc-foot { display: flex; justify-content: space-between; align-items: center; }
.price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.price small, .plan-price small { color: var(--muted); }

.contact { display: flex; align-items: center; gap: 10px; color: var(--ok); font-weight: 500; }

.option { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.option input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; margin: 0; }
.option.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.option .end { text-align: left; }
.option > .ic { color: var(--muted); }

details.add summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 14px; list-style: none; padding: 4px 0; }
details.add summary::-webkit-details-marker { display: none; }
.car-form { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 6px; }

/* ---------- الباقات ---------- */
.plans { display: flex; flex-direction: column; gap: 14px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.plan.popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 16px 40px -20px var(--accent); }
.ribbon { position: absolute; top: -11px; left: 16px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-price { font-size: 28px; font-weight: 700; }
.plan-price .muted { font-size: 14px; font-weight: 400; }
.save { font-size: 13px; color: var(--ok); }
.save s { color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.plan li .ic { color: var(--ok); }

/* ---------- الحجز ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.day small { color: var(--muted); font-size: 10px; }
.day b { font-size: 17px; }
.day.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.day.on small { color: var(--accent); }
.hours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hour { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 0; cursor: pointer; font-size: 14px; }
.hour.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.hour:disabled { opacity: .3; cursor: not-allowed; text-decoration: line-through; }

.summary { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.summary .line { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }

/* ---------- الحجوزات ---------- */
.booking { display: flex; align-items: flex-start; gap: 12px; }
.booking .grow { display: flex; flex-direction: column; gap: 2px; }
.actions { display: flex; gap: 18px; margin-top: 8px; }
.status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status.confirmed { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.status.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.status.cancelled { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.after-shot { position: relative; margin: 8px 0 0; border-radius: 12px; overflow: hidden; }
.after-shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.after-shot figcaption { position: absolute; bottom: 8px; right: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.empty { text-align: center; padding: 40px 0; display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* ---------- تنبيه ---------- */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 500; z-index: 50; transition: .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 520px) {
  #app { border-inline: 1px solid var(--line); }
}
