/* «صوتك مسموع» — shared tokens, type and controls for the form and the dashboard. */

@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url('fonts/tajawal-arabic-400-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap; src: url('fonts/tajawal-arabic-500-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url('fonts/tajawal-arabic-700-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 800; font-display: swap; src: url('fonts/tajawal-arabic-800-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url('fonts/tajawal-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap; src: url('fonts/tajawal-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url('fonts/tajawal-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;

  /* Defaults: the form's light set. Each surface restates every token for both of its themes
     (apps/public/public/form.css, apps/admin/public/admin.css). Ink is navy-tinted, never neutral gray. */
  --ink: #0b1246;
  --ink-2: #4a5180;
  --ink-3: #6b729b;          /* placeholders, 4.6:1 on white */
  --line: #e2e5f0;           /* dividers */
  --field-line: #8b91b5;     /* control borders, 3:1 on white */

  --brand: #f06812;
  --brand-hover: #ff7f2e;
  --brand-press: #9a3b00;
  --brand-tint: #fff0e6;
  --brand-tint-2: #fff8f3;

  --page: #ffffff;
  --surface: #ffffff;
  --control-bg: #ffffff;
  --on-brand: #0b1246;
  --danger-ink: #7a1a12;
  --success-ink: #0f5a2a;
  --warning-ink: #6b3f00;
  --danger-solid: #b42318;
  --surface-2: #f3f4fa;
  --surface-3: #e9ebf5;

  --danger: #b42318;
  --danger-tint: #fef1f0;
  --success: #157f3b;
  --success-tint: #edf8f1;
  --warning: #9a5b00;
  --warning-tint: #fff6e5;

  --radius: 12px;
  --radius-sm: 8px;
  --focus: 0 0 0 3px rgba(240, 104, 18, 0.35);
  --shadow-1: 0 1px 2px rgba(11, 18, 70, 0.06), 0 2px 8px rgba(11, 18, 70, 0.05);
  --shadow-2: 0 8px 28px rgba(11, 18, 70, 0.12), 0 2px 6px rgba(11, 18, 70, 0.06);

  --font: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
ul, ol { padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

::selection { background: #ffd9bf; color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: #b9bed6 transparent; }
input, textarea { caret-color: var(--brand); }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-primary:active { background: var(--brand-press); }
.btn-secondary { background: var(--surface); border-color: var(--field-line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-2); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: #e7b7b2; color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger-solid); color: #fff; }
.btn-danger-solid:hover { background: #8f1c13; }
.btn[disabled], .btn[aria-disabled='true'] { cursor: not-allowed; opacity: 0.55; }
.btn .spin { animation: spin 0.9s linear infinite; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 1.0625rem; border-radius: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- fields ---------- */
.field { display: grid; gap: 8px; }
.label { font-weight: 700; font-size: 1rem; line-height: 1.4; color: var(--ink); }
.label .opt { font-weight: 500; color: var(--ink-2); font-size: 0.875rem; margin-inline-start: 6px; }
.hint { font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--control-bg);
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius);
  font-size: 1.0625rem; /* 17px: avoids iOS zoom on focus */
  line-height: 1.5;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.textarea { min-height: 148px; resize: vertical; }
.select {
  appearance: none;
  padding-inline-end: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5180' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: left 14px center;
  background-size: 18px 18px;
  background-repeat: no-repeat;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--ink-2); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[aria-invalid='true'], .textarea[aria-invalid='true'], .select[aria-invalid='true'] { border-color: var(--danger); }
.input[aria-invalid='true']:focus, .textarea[aria-invalid='true']:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.22); }
.input[disabled], .textarea[disabled], .select[disabled] { background: var(--surface-2); color: var(--ink-2); cursor: not-allowed; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

.field-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.counter { font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; }
.counter.over { color: var(--danger); font-weight: 700; }

.error {
  display: flex; align-items: flex-start; gap: 6px;
  color: var(--danger); font-size: 0.9375rem; font-weight: 500; line-height: 1.45;
}
.error .icon-sm { margin-top: 2px; }

/* Segmented choice (radio buttons laid out as one control) */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
/* Chip grid (radio buttons that wrap) */
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 12px;
  border: 1.5px solid var(--field-line); border-radius: var(--radius);
  background: var(--control-bg); color: var(--ink);
  font-weight: 500; font-size: 1rem; line-height: 1.3; text-align: center;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.choice span .icon-sm { display: none; }
.choice:hover span { border-color: var(--ink-2); }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-press); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:checked + span .icon-sm { display: block; }
.choice input:focus-visible + span { box-shadow: var(--focus), inset 0 0 0 1px var(--brand); }
.choice input[aria-invalid='true'] + span { border-color: var(--danger); }
.choice input:disabled + span { opacity: 0.55; cursor: not-allowed; }

/* Notices */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink); font-size: 0.9375rem; line-height: 1.55;
}
.notice .icon { margin-top: 1px; color: var(--ink-2); }
.notice-danger { background: var(--danger-tint); color: var(--danger-ink); }
.notice-danger .icon { color: var(--danger); }
.notice-success { background: var(--success-tint); color: var(--success-ink); }
.notice-success .icon { color: var(--success); }
.notice-warning { background: var(--warning-tint); color: var(--warning-ink); }
.notice-warning .icon { color: var(--warning); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
