/* NAFAS Community: brand tokens and shared components (website + admin).
   Palette from the NAFAS brand guide: ~60% sage and sand, 25% deep forest,
   10% cream, 5% terracotta (accent only). Cream on sage only for large type. */
html, body { background: #F7EEDC; }

:root {
  --sage: #687F69;
  --sage-dark: #5b715c;
  --forest: #384F40;
  --forest-2: #2e4335;
  --sand: #EBDDCA;
  --sand-2: #e2d1ba;
  --cream: #F7EEDC;
  --paper: #FBF6EC;
  --terra: #D8AA87;
  --terra-ink: #9a6640;          /* terracotta darkened for text and focus rings on light grounds */

  --bg: var(--cream);
  --surface: var(--paper);
  --raised: var(--sand);
  --ink: var(--forest);
  --ink-2: #566a5b;
  --muted: #6f7f70;
  --line: rgba(56, 79, 64, 0.14);
  --line-strong: rgba(56, 79, 64, 0.26);

  --good: #3f7a52;
  --bad: #a2442c;
  --warn: #a4692b;

  --font: "Jost", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Tajawal", "Jost", system-ui, sans-serif;
  --font-mono: "Jost", system-ui, sans-serif;   /* Jost has tabular figures; one family keeps the brand calm */

  --r-sm: 6px;
  --r-ctl: 12px;
  --r-card: 20px;
  --r-panel: 24px;
  --arch: 999px 999px 0 0;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(56, 79, 64, 0.08);
  --shadow-float: 0 18px 40px rgba(56, 79, 64, 0.14), 0 2px 6px rgba(56, 79, 64, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(216, 170, 135, 0.45); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 300; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--terra-ink); outline-offset: 3px; border-radius: 6px; }

.ar { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; letter-spacing: 0 !important; text-transform: none !important; }
.num, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.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; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-16 { width: 16px; height: 16px; }

/* Wide-tracked labels, as in the brand (MOVE · CREATE · RECHARGE) */
.label-wide { font-size: 12px; font-weight: 400; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--forest); color: var(--cream);
  font-size: 15px; font-weight: 400; letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn:hover { background: var(--forest-2); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--forest); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(56, 79, 64, 0.06); }
.btn-cream { background: var(--cream); color: var(--forest); }
.btn-cream:hover { background: #fff; }
.btn-line-cream { background: transparent; color: var(--cream); border-color: rgba(247, 238, 220, 0.5); }
.btn-line-cream:hover { background: rgba(247, 238, 220, 0.1); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn-quiet:hover { background: rgba(56, 79, 64, 0.06); color: var(--ink); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform 160ms var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn .ar { font-size: 14px; opacity: 0.8; }

/* Forms */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 14px; font-weight: 400; color: var(--ink-2); }
.field > span .ar { margin-inline-start: 6px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  font-size: 15px; line-height: 1.4;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.textarea { min-height: 112px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #9aa79b; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(56, 79, 64, 0.4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(104, 127, 105, 0.2); }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23566a5b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.hint { font-size: 13px; color: var(--muted); }
.form-error { min-height: 20px; font-size: 14px; color: var(--bad); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }

/* Quantity stepper */
.stepper { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; }
.stepper button { width: 34px; height: 34px; border: 0; background: none; border-radius: 999px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); transition: background-color 120ms var(--ease); }
.stepper button:hover { background: var(--sand); color: var(--ink); }
.stepper output { min-width: 24px; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }

/* Choice chips (radio-like) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  font-size: 14px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}
.chip:hover { color: var(--ink); background: rgba(56, 79, 64, 0.05); }
.chip[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.chip .ar { font-size: 13px; opacity: 0.75; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--sand); font-size: 13px; color: var(--ink); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.badge.good::before { background: var(--good); }
.badge.warn::before { background: var(--warn); }
.badge.bad::before { background: var(--bad); }
.badge.accent::before { background: var(--terra); }

/* The signature: an arch-topped card, like a doorway */
.arch-card { position: relative; background: var(--paper); border-radius: 240px 240px var(--r-card) var(--r-card); padding: 72px 32px 32px; }
.arch-card::before {
  content: ""; position: absolute; inset: 10px 10px auto; height: calc(100% - 20px);
  border: 1px solid var(--terra); border-bottom: 0; border-radius: 232px 232px 0 0; pointer-events: none; opacity: 0.7;
}
.code { font-size: 28px; letter-spacing: 0.12em; font-weight: 400; font-variant-numeric: tabular-nums; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200;
  transform: translate(-50%, 12px); opacity: 0;
  padding: 12px 22px; border-radius: 999px;
  background: var(--forest); color: var(--cream); font-size: 14px;
  box-shadow: var(--shadow-float);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); }

/* Motion */
.rise { opacity: 0; transform: translateY(12px); animation: rise 700ms var(--ease) forwards; animation-delay: calc(var(--i, 0) * 90ms + 100ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

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

/* Skeleton placeholders while data loads */
.sk { position: relative; overflow: hidden; background: rgba(56, 79, 64, 0.08); border-radius: 12px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: sk 1.3s ease-in-out infinite; }
@keyframes sk { to { transform: translateX(100%); } }
.sk-row { height: 64px; margin: 10px 0; }
.sk-chip { display: inline-block; width: 96px; height: 38px; border-radius: 999px; margin-right: 8px; }
.sk-card { height: 180px; border-radius: 20px; }
.sk-cal { aspect-ratio: 1; border-radius: 999px; }
.sk-tile { height: 92px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .sk::after { display: none; } }

/* Scrollbar: a thin sage line on every page (site and team area), no track or arrows */
::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(104, 127, 105, 0.45); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--sage); }
::-webkit-scrollbar-button, ::-webkit-scrollbar-corner { display: none; background: transparent; }
@supports (-moz-appearance: none) { html, * { scrollbar-width: thin; scrollbar-color: rgba(104, 127, 105, 0.5) transparent; } }

/* Text being typed in (booking summary): a soft blinking caret at its end */
.is-typing::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-inline-start: 2px; vertical-align: -0.12em; background: currentColor; animation: caret 0.7s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* A place that still needs filling in */
.field.is-invalid .input, .field.is-invalid .textarea, .field.is-invalid .select,
.field.is-invalid .chip:not([aria-pressed="true"]) { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(162, 68, 44, 0.14); }
.field.is-invalid > span:first-child, .field.is-invalid > span:first-child * { color: var(--bad); }
.is-invalid { animation: nudge 360ms var(--ease); }
@keyframes nudge { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ---------- Our own "are you sure?" pop-up ---------- */
.ask {
  width: min(400px, calc(100vw - 32px)); padding: 28px 24px 22px; border: 0; border-radius: 24px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-float); text-align: center;
  animation: askIn 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ask::backdrop { background: rgba(46, 67, 53, 0.5); animation: askShade 240ms ease both; }
.ask.leaving { animation: askOut 200ms ease both; }
.ask-mark { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: #f3e3dc; color: var(--bad); }
.ask-mark .icon { width: 22px; height: 22px; }
.ask h2 { font-size: 21px; font-weight: 400; line-height: 1.3; }
.ask p { margin-top: 8px; color: var(--ink-2); font-weight: 300; font-size: 15px; line-height: 1.5; }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.ask-actions .btn { width: 100%; height: 48px; justify-content: center; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: #8d3a25; border-color: #8d3a25; color: #fff; }
@keyframes askIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes askOut { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes askShade { from { background: rgba(46, 67, 53, 0); } }
@media (max-width: 560px) {
  .ask { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); animation-name: askUp; }
  .ask.leaving { animation-name: askDown; }
  @keyframes askUp { from { transform: translateY(100%); } }
  @keyframes askDown { to { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) { .ask, .ask.leaving, .ask::backdrop { animation: none; } }
