/* SARH Holding — shared foundations (fonts, tokens, primitives) */

@font-face { font-family: 'Cairo'; src: url('/fonts/cairo-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('/fonts/cairo-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('/fonts/cairo-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Qomra'; src: url('/fonts/qomra-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Qomra'; src: url('/fonts/qomra-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
/* Poppins carries numerals only (brand rule: numbers in Poppins); everything else falls back to Cairo. */
@font-face { font-family: 'SarhNum'; src: url('/fonts/poppins-500.woff2') format('woff2'); font-weight: 400 500; font-display: swap; unicode-range: U+0020, U+0025, U+0028-0029, U+002B-003A, U+2013; }
@font-face { font-family: 'SarhNum'; src: url('/fonts/poppins-600.woff2') format('woff2'); font-weight: 600 700; font-display: swap; unicode-range: U+0020, U+0025, U+0028-0029, U+002B-003A, U+2013; }

:root {
  color-scheme: light;
  /* brand */
  --forest: #054239;
  --forest-hover: #03312a;
  --forest-tint: #edf4f2;
  --forest-tint-2: #d9e8e3;
  --teal: #428177;
  --gold: #b9a779;
  --gold-ink: #75653a;
  --cream: #f3ecd9;

  /* surfaces & ink */
  --page: #f8f6f0;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #161616;
  --ink-2: #4c4b46;
  --ink-3: #75736c;
  --line: #e6e0d1;
  --line-strong: #cfc6ae;

  /* feedback */
  --error: #b42318;
  --error-tint: #fdf0ee;
  --critical: #d03b3b;
  --warning: #fab219;
  --good: #0ca30c;

  --font-display: 'Qomra', 'Cairo', system-ui, sans-serif;
  --font-body: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-num: 'SarhNum', 'Cairo', system-ui, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --focus-ring: 0 0 0 3px rgba(5, 66, 57, 0.28);
  --shadow-1: 0 1px 2px rgba(22, 22, 22, 0.05), 0 1px 1px rgba(22, 22, 22, 0.03);
  --shadow-2: 0 12px 32px -12px rgba(22, 22, 22, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
a { color: var(--forest); text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.num { font-family: var(--font-num); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--forest-hover); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not([disabled]) { border-color: var(--forest); color: var(--forest); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 0 12px; min-height: 38px; }
.btn-quiet:hover { color: var(--forest); background: var(--forest-tint); }
.btn-danger { background: transparent; border-color: #e7b4ad; color: var(--error); }
.btn-danger:hover { background: var(--error-tint); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* ---------- inputs */
.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 16px; /* prevents iOS zoom */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--forest); box-shadow: var(--focus-ring); }
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] { border-color: var(--error); }
.input::placeholder, .textarea::placeholder { color: #a3a097; }
.input.ltr { direction: ltr; text-align: right; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-inline-start: 14px; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%234c4b46' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center;
  cursor: pointer;
}

.field-label { display: block; font-weight: 600; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--ink-3); font-size: 13px; }

.error-text {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--error);
}
.error-text::before {
  content: '!'; flex: none; display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin-top: 3px; border-radius: 50%;
  background: var(--error); color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
