/* ==========================================================================
   Ghaith Design System · base + components
   Shared by the website and the admin panel.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.icon { width: 1.2em; height: 1.2em; flex: none; display: inline-block; vertical-align: middle; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-tight); margin: 0; text-wrap: balance; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--red-100); color: var(--red-900); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.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; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--s-6));
  margin-inline: auto;
  padding-left: max(var(--s-5), env(safe-area-inset-left, 0px));
  padding-right: max(var(--s-5), env(safe-area-inset-right, 0px));
}
@media (max-width: 480px) {
  .container { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* ---- Eyebrow: the three dots of ث + a label ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-14);
  color: var(--action); letter-spacing: .01em;
}
.eyebrow::before {
  content: ""; width: 18px; height: 14px; flex: none;
  background:
    radial-gradient(circle at 50% 3px, currentColor 3px, transparent 3.5px),
    radial-gradient(circle at 3px 11px, currentColor 3px, transparent 3.5px),
    radial-gradient(circle at 15px 11px, currentColor 3px, transparent 3.5px);
}
.eyebrow--light { color: var(--red-100); }

/* ---- Buttons ---- */
.btn {
  --btn-bg: var(--action); --btn-fg: #fff; --btn-bd: var(--action);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: var(--r-pill); border: 2px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-16); line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), box-shadow var(--t-base) var(--ease-out), color var(--t-fast);
  position: relative; isolation: isolate; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(153, 0, 0, .6); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary:hover { --btn-bg: var(--action-hover); --btn-bd: var(--action-hover); }
.btn--ink { --btn-bg: var(--ink-700); --btn-bd: var(--ink-700); }
.btn--ink:hover { box-shadow: 0 12px 24px -12px rgba(46, 6, 6, .6); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink-700); --btn-bd: var(--ink-200); }
.btn--ghost:hover { --btn-bd: var(--ink-700); box-shadow: none; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--red-700); --btn-bd: #fff; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: var(--fs-14); }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .7; pointer-events: none; }

/* ---- Form fields ---- */
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: var(--fs-14); color: var(--ink-700); }
.field .hint { font-size: var(--fs-12); color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; min-height: 54px; padding: 12px 18px;
  background: var(--paper); border: 2px solid var(--ink-200); border-radius: var(--r-md);
  font-size: var(--fs-16); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%), linear-gradient(135deg, var(--ink-500) 50%, transparent 50%); background-position: 22px 50%, 16px 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-left: 40px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--red-700); box-shadow: 0 0 0 4px var(--red-100); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.field .error { color: var(--danger); font-size: var(--fs-14); font-weight: 500; min-height: 1em; }
.input--phone { direction: ltr; text-align: right; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* ---- Chips and badges ---- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  border-radius: var(--r-pill); background: var(--paper); border: 1.5px solid var(--ink-200);
  font-size: var(--fs-14); font-weight: 600; color: var(--ink-700); white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action); }

/* ---- Card with the drop corner ---- */
.card { background: var(--surface); border-radius: var(--r-drop); border: 1.5px solid var(--line); padding: var(--s-6); }
.card--soft { border: 0; background: var(--surface-alt); }

/* ---- Ghaith's speech bubble ---- */
.bubble {
  position: relative; display: inline-block; background: #fff; color: var(--ink-900);
  border: 2.5px solid var(--red-700); border-radius: 22px; padding: 12px 18px;
  font-family: var(--font-voice); font-weight: 600; font-size: var(--fs-18); line-height: 1.45;
}
.bubble::after {
  content: ""; position: absolute; bottom: -12px; inset-inline-start: 28px; width: 18px; height: 18px;
  background: #fff; border-inline-start: 2.5px solid var(--red-700); border-bottom: 2.5px solid var(--red-700);
  transform: skewY(-35deg); border-end-start-radius: 4px;
}
.bubble--tail-end::after { inset-inline-start: auto; inset-inline-end: 28px; transform: skewY(35deg); border-inline-start: 0; border-inline-end: 2.5px solid var(--red-700); }

/* ---- Call status pills (admin) ---- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-12); font-weight: 700; line-height: 1.6; white-space: nowrap;
  background: var(--ink-100); color: var(--ink-700);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* Statuses are told apart by fill strength and shape, all within the red scale */
.pill--new { background: var(--white); color: var(--red-700); box-shadow: inset 0 0 0 1.5px var(--red-700); }
.pill--no_answer { background: var(--red-100); color: var(--red-700); }
.pill--busy { background: var(--red-100); color: var(--red-900); }
.pill--busy::before { border-radius: 2px; }
.pill--call_later { background: var(--red-50); color: var(--red-600); box-shadow: inset 0 0 0 1.5px var(--red-300); }
.pill--call_later::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.pill--booked { background: var(--red-700); color: var(--white); }
.pill--visited { background: var(--red-900); color: var(--white); }
.pill--not_interested { background: var(--ink-100); color: var(--ink-500); }
.pill--wrong_number { background: var(--ink-100); color: var(--ink-500); text-decoration: line-through; }

/* ---- Alerts ---- */
.alert { padding: 14px 18px; border-radius: var(--r-md); font-weight: 500; border: 1.5px solid transparent; }
.alert--ok { background: var(--red-50); color: var(--red-700); border-color: var(--red-200); }
.alert--error { background: var(--red-700); color: var(--white); }
.alert--info { background: var(--white); color: var(--red-700); border-color: var(--red-200); }

/* Motion plays for every visitor (owner's decision), so there is no reduced-motion override here. */
