/* =========================================================================
   style.css — design system applied to the consumer complaint page.
   Every colour comes from tokens.css. Radius: 4px / 6px / 50% only.
   Spacing: 4 / 8 / 12 / 16 / 24 / 32 / 40. No font above 30px.
   ========================================================================= */

/* ---------- 0. Font — IBM Plex Sans Arabic, self-hosted ------------------
   Arabic subsets are complete: users type arbitrary Arabic into the form.
   Latin subsets are trimmed to ASCII, all this page needs from them (digits,
   phone numbers, email). font-display:swap keeps first paint instant. */
@font-face {
  font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/plex-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2026, U+00D7;
}
@font-face {
  font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/plex-400-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E,
                 U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/plex-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2026, U+00D7;
}
@font-face {
  font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/plex-600-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E,
                 U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  font-family: var(--ff);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.35; margin: 0; font-weight: var(--fw-bold); }
p { margin: 0; }
ul, ol { margin: 0; padding-inline-start: var(--sp-6); }
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--primary-soft);
  border-radius: var(--radius);
}

.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;
}

.skip-link {
  position: absolute; inset-inline-start: var(--sp-4); top: -100px; z-index: 60;
  background: var(--primary); color: var(--on-dark);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: var(--fs-body); font-weight: var(--fw-bold);
}
.skip-link:focus { top: 0; text-decoration: none; }

/* ---------- 2. Layout — one container width for every section ---------- */
.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
.wrap-narrow { max-width: 1080px; }

.section { padding-block: var(--sp-8); }

/* ---------- 3. Top nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); min-height: 56px;
}

.brand { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: var(--radius); }
.brand-mark .mark-bg { fill: var(--primary); }
.brand-mark .mark-tick { stroke: var(--on-dark); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.brand-text strong {
  font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small { font-size: var(--fs-meta); color: var(--text-muted); }

.header-meta {
  display: none; flex-direction: column; text-align: end;
  font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.45;
}
.header-divider { display: none; width: 1px; height: 24px; background: var(--border); flex: none; }
.header-cta { flex: none; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 var(--sp-6);
  font-size: var(--fs-body); font-weight: var(--fw-bold);
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--primary); color: var(--on-dark);
  cursor: pointer; text-align: center;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-surface); color: var(--text-primary); border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 var(--sp-3); }

.spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--primary-soft); border-top-color: var(--on-dark);
  animation: spin .7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--link); font-size: inherit; font-weight: var(--fw-bold); cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 5. Card ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}
.card-head {
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: var(--fs-section); font-weight: var(--fw-bold); color: var(--text-primary); }

.section-title {
  font-size: var(--fs-section); font-weight: var(--fw-bold);
  color: var(--text-primary); margin-bottom: var(--sp-6);
}

/* ---------- 6. Hero ---------- */
.hero { padding-block: var(--sp-8); }
.hero-grid { display: grid; gap: var(--sp-6); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--primary-soft); color: var(--primary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  font-size: var(--fs-meta); font-weight: var(--fw-bold);
  margin-bottom: var(--sp-4);
}
.eyebrow-flag { width: 20px; height: 14px; flex: none; }

.page-title {
  font-size: var(--fs-page-title); font-weight: var(--fw-bold);
  color: var(--text-primary); margin-bottom: var(--sp-4);
}
.hero-sub {
  font-size: var(--fs-nav); color: var(--text-secondary);
  max-width: 56ch; margin-bottom: var(--sp-6);
}

.trust-list {
  list-style: none; padding: 0; margin: 0 0 var(--sp-6);
  display: grid; gap: var(--sp-3);
}
.trust-list li {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-body); color: var(--text-secondary);
}
.trust-list svg { width: 16px; height: 16px; flex: none; fill: var(--primary); }

.hero-actions { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.hero-note { font-size: var(--fs-meta); color: var(--text-muted); }

/* ---------- 7. Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); }
.step {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}
.step-num {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: var(--fs-label); font-weight: var(--fw-bold);
  margin-bottom: var(--sp-3);
}
.step h3 { font-size: var(--fs-section); margin-bottom: var(--sp-2); }
.step p { font-size: var(--fs-body); color: var(--text-secondary); }

/* ---------- 8. Key–value rows ---------- */
.kv { display: grid; }
.kv-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-4); padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-key { font-size: var(--fs-body); color: var(--text-secondary); flex: none; }
.kv-val { font-size: var(--fs-body); color: var(--text-primary); text-align: end; min-width: 0; }

/* ---------- 9. Form ---------- */
.form-grid { display: grid; gap: var(--sp-6); }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }

label, .label-like {
  display: block;
  font-size: var(--fs-label); font-weight: var(--fw-regular);
  color: var(--text-secondary); margin-bottom: 6px;
}
.hint-inline { color: var(--text-muted); }
.req { color: var(--danger); }

input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--sp-3);
  font-family: inherit;
  font-size: var(--fs-input-touch);   /* 16px stops iOS Safari zooming on focus */
  font-weight: var(--fw-regular);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 120ms ease, background-color 120ms ease;
  -webkit-appearance: none; appearance: none;
}
textarea { padding: var(--sp-3); min-height: 140px; resize: vertical; line-height: 1.6; }

input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input:disabled, textarea:disabled { background: var(--bg-subtle); color: var(--text-muted); }

#phone { direction: ltr; text-align: start; }

.hint { display: block; font-size: var(--fs-meta); color: var(--text-muted); margin-top: var(--sp-1); }

.err { display: none; font-size: var(--fs-meta); color: var(--danger); margin-top: var(--sp-1); }
.err.show { display: block; }
input.invalid, textarea.invalid { border-color: var(--danger); }
input.invalid:focus, textarea.invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft); }

.form-err {
  display: none; margin-top: var(--sp-4);
  padding: var(--sp-3); border-inline-start: 3px solid var(--danger);
  background: var(--danger-soft); color: var(--danger);
  font-size: var(--fs-body); border-radius: var(--radius);
}
.form-err.show { display: block; }

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

/* checkbox */
.check { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; margin: 0; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  flex: none; width: 20px; height: 20px; margin-top: 2px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-surface);
  display: grid; place-items: center;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.check-box svg {
  width: 12px; height: 12px; fill: none; stroke: var(--on-dark);
  stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; visibility: hidden;
}
.check input:checked + .check-box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .check-box svg { visibility: visible; }
.check input:focus-visible + .check-box {
  outline: 2px solid var(--primary); outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.check input.invalid + .check-box { border-color: var(--danger); }
.check-text { font-size: var(--fs-body); color: var(--text-secondary); }

.form-foot { font-size: var(--fs-meta); color: var(--text-muted); margin-top: var(--sp-4); }
.form-actions { margin-top: var(--sp-6); }

/* ---------- 10. FAQ accordion ---------- */
.accordion { border-top: 1px solid var(--border); }
.acc-item { border-bottom: 1px solid var(--border); }
.acc-item h3 { margin: 0; font-size: var(--fs-body); }
.acc-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); min-height: 56px; padding: var(--sp-3) 0;
  background: none; border: 0; cursor: pointer; text-align: start;
  font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--text-primary);
  transition: color 120ms ease;
}
.acc-trigger:hover { color: var(--primary); }
.acc-icon {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: var(--text-muted); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.acc-trigger[aria-expanded="true"] .acc-icon { transform: rotate(180deg); stroke: var(--primary); }
.acc-panel { padding: 0 0 var(--sp-4); }
.acc-panel p, .acc-panel li { font-size: var(--fs-body); color: var(--text-secondary); }
.acc-panel p + p, .acc-panel p + ul { margin-top: var(--sp-3); }
.acc-panel li + li { margin-top: var(--sp-2); }

/* ---------- 11. Footer ---------- */
.site-footer {
  background: var(--primary); color: var(--on-dark-dim);
  padding-block: var(--sp-8);
  padding-bottom: calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
}
.footer-grid { display: grid; gap: var(--sp-8); }
.footer-h { font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--on-dark); margin-bottom: var(--sp-3); }
.footer-about { font-size: var(--fs-body); color: var(--on-dark-dim); }
.site-footer a { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .link-btn { color: var(--on-dark); font-weight: var(--fw-regular); text-align: start; }

.footer-address { font-style: normal; display: grid; gap: var(--sp-2); font-size: var(--fs-body); }
.footer-address a { display: inline-flex; align-items: center; min-height: 38px; }

.footer-links { list-style: none; padding: 0; margin: 0; display: grid; }
.footer-links .link-btn { display: inline-flex; align-items: center; min-height: 38px; }

.legal-notice {
  margin-top: var(--sp-8); padding-top: var(--sp-6);
  border-top: 1px solid var(--on-dark-line);
}
.legal-notice p { font-size: var(--fs-meta); color: var(--on-dark-dim); }
.legal-notice p + p { margin-top: var(--sp-2); }
.copyright {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid var(--on-dark-line);
  font-size: var(--fs-meta); color: var(--on-dark-dim);
}

/* ---------- 12. Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; }
.modal[hidden] { display: none; }
.modal-overlay { position: absolute; inset: 0; background: var(--overlay); }
.modal-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: 100%; max-height: 100%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-modal);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  flex: none;
}
.modal-head h2 { font-size: var(--fs-section); font-weight: var(--fw-bold); }
.modal-close {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; margin: calc(var(--sp-1) * -1);
  background: none; border: 0; border-radius: var(--radius);
  cursor: pointer; color: var(--text-secondary);
  transition: background-color 120ms ease;
}
.modal-close:hover { background: var(--bg-subtle); }
.modal-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.modal-body {
  padding: var(--sp-4);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}
.modal-body h3 { font-size: var(--fs-body); font-weight: var(--fw-bold); margin: var(--sp-6) 0 var(--sp-2); }
.modal-body h3:first-of-type { margin-top: 0; }
.modal-body p, .modal-body li { font-size: var(--fs-body); color: var(--text-secondary); }
.modal-body p + p, .modal-body p + ul, .modal-body ul + p { margin-top: var(--sp-3); }
.modal-body li + li { margin-top: var(--sp-2); }
.modal-updated { font-size: var(--fs-meta); color: var(--text-muted); margin-bottom: var(--sp-6); }
.modal-body-center { text-align: center; }

.success-icon {
  width: 48px; height: 48px; margin: var(--sp-4) auto;
  border-radius: 50%; background: var(--success-soft);
  display: grid; place-items: center;
}
.success-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.success-lead { margin-bottom: var(--sp-6); color: var(--text-secondary); }

.ref-box {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-subtle);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
}
.ref-label { display: block; font-size: var(--fs-label); color: var(--text-secondary); margin-bottom: var(--sp-2); }
.ref-code {
  display: block; font-size: var(--fs-section); font-weight: var(--fw-bold);
  color: var(--text-primary); letter-spacing: .04em; margin-bottom: var(--sp-3);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.copy-status { display: block; font-size: var(--fs-meta); color: var(--success); margin-top: var(--sp-2); min-height: 18px; }
.success-note { font-size: var(--fs-meta); color: var(--text-muted); margin-bottom: var(--sp-6); }

body.modal-open { overflow: hidden; }

/* ---------- 13. Responsive ---------- */
@media (min-width: 560px) {
  .trust-list { grid-auto-flow: column; justify-content: start; gap: var(--sp-6); }
  .hero-actions { grid-auto-flow: column; justify-content: start; }
  .modal { align-items: center; justify-content: center; padding: var(--sp-4); }
  .modal-box { max-width: 720px; max-height: 88vh; border-radius: var(--radius-lg); }
  .modal-box-sm { max-width: 440px; }
  .modal-head, .modal-body { padding: var(--sp-6); }
  .modal-body { padding-bottom: var(--sp-6); }
}

@media (min-width: 768px) {
  .wrap { padding-inline: var(--sp-8); }
  .header-inner { min-height: 64px; }
  .header-meta, .header-divider { display: flex; }
  .section { padding-block: var(--sp-10); }
  .hero { padding-block: var(--sp-10); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1.2fr .8fr; }

  /* 38px controls on pointer devices; 48px stays on touch */
  input[type="text"], input[type="tel"], input[type="email"] {
    min-height: 38px; font-size: var(--fs-body);
  }
  textarea { font-size: var(--fs-body); }
  .btn { min-height: 38px; }
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: var(--sp-10); align-items: start; }
}

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

@media print {
  .site-header, .hero-actions, .form-actions, .modal { display: none !important; }
  body { background: var(--bg-surface); }
}

/* ---------- 15. Thanks page ---------- */
.thanks-card { text-align: center; }
.thanks-card .success-icon { margin-inline: auto; }
.thanks-lead { color: var(--text-secondary); margin-bottom: var(--sp-6); }
.thanks-next { margin-bottom: var(--sp-3); }
.thanks-steps {
  text-align: start; margin: 0 0 var(--sp-6);
  display: grid; gap: var(--sp-2);
  color: var(--text-secondary);
}
.thanks-warn {
  text-align: start; font-size: var(--fs-meta); color: var(--text-secondary);
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-3); margin-bottom: var(--sp-6);
}
