/* ============ Balaki Cosmetic — design system ============ */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #fbf7f4;
  --surface: #ffffff;
  --surface-2: #f7efe9;
  --ink: #2c2321;
  --ink-soft: #5d504b;
  --muted: #9a8a83;
  --line: #ede2dc;
  --line-strong: #e0d2ca;
  --rose: #c48b8b;
  --rose-deep: #a96060;
  --rose-soft: #f7e8e5;
  --rose-mist: #fdf3f1;
  --gold: #b58a4f;
  --gold-soft: #f2e7d2;
  --green: #5e8c61;
  --green-soft: #e7f2e7;
  --red: #c2554f;
  --red-soft: #fae9e8;
  --blue: #5b7fa6;
  --blue-soft: #e8f0f8;
  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 22px 50px -26px rgba(60, 40, 35, 0.28);
  --shadow-soft: 0 10px 30px -18px rgba(60, 40, 35, 0.25);
  --header-h: 78px;
  --font-latin: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Playfair Display", "Noto Kufi Arabic", Georgia, serif;
  --font-kur: "Noto Kufi Arabic", "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-latin);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body { font-family: var(--font-kur); }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5 {
  font-family: var(--font-kur);
  font-weight: 700;
  letter-spacing: 0;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--rose-soft); color: var(--rose-deep); }

:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fdf8f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -14px rgba(44, 35, 33, 0.55); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }

.btn-rose { --btn-bg: var(--rose-deep); --btn-fg: #fff; }
.btn-gold { --btn-bg: var(--gold); --btn-fg: #fff; }
.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn-soft {
  --btn-bg: var(--rose-soft);
  --btn-fg: var(--rose-deep);
}
.btn-soft:hover { background: #f2d9d6; }
.btn-sm { padding: 10px 18px; font-size: 13.5px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 46px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(196, 139, 139, 0.16);
}
.textarea { resize: vertical; min-height: 90px; }
.input::placeholder, .textarea::placeholder { color: #b6a8a2; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a8a83' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: right 14px center;
  padding-right: 40px;
}
html[dir="rtl"] .select { background-position: left 14px center; padding-right: 15px; padding-left: 40px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.badge.gold { background: var(--gold-soft); color: #8a6432; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.ink { background: var(--ink); color: #fff; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.2s;
  white-space: nowrap;
}
.pill:hover { border-color: var(--rose); color: var(--rose-deep); }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- utilities ---------- */
.container { width: min(1240px, 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.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;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.eyebrow::before { content: ""; width: 26px; height: 1.5px; background: var(--rose); }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--rose-deep);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading {
  min-height: 46vh;
  display: grid;
  place-items: center;
}

/* ---------- toast ---------- */
.toast-root {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
html[dir="rtl"] .toast-root { transform: translateX(50%); }
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s var(--ease);
  max-width: min(92vw, 460px);
  text-align: center;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- reveal ---------- */
.reveal { animation: fade-up 0.55s var(--ease) both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .container { width: min(1240px, 100% - 32px); }
  .field-row { grid-template-columns: 1fr; }
}
