/*
 * OctoMediCare Enquiry — design system.
 *
 * Hand-written rather than generated, so the app needs no build step: edit,
 * upload, done. Layout uses CSS logical properties (inline-start/end) so the
 * Arabic RTL page needs no separate stylesheet.
 *
 * Colours are sampled from the official logo, which runs deep blue through
 * cyan to lime. The blue end carries the interface because it holds contrast
 * on white; the green end is reserved for accents and the gradient rule.
 */

:root {
  color-scheme: light;

  --ink: #0a1b2a;
  --ink-soft: #33465a;
  --ink-muted: #5a6b7b;

  --canvas: #f5f8fa;
  --surface: #ffffff;
  --surface-sunken: #eef3f7;

  --line: #e0e8ee;
  --line-strong: #c6d3dd;

  --brand-50: #e9f3fc;
  --brand-100: #cbe4f8;
  --brand-500: #0086d4;
  --brand-600: #005cb4;   /* primary — 6.6:1 on white */
  --brand-700: #00478f;
  --brand-900: #002e5c;

  --brand-cyan: #00afe5;
  --brand-teal: #00d1c7;
  --brand-green: #1cd282;
  --brand-lime: #97f444;

  --danger: #b42318;
  --danger-bg: #fef3f2;
  --whatsapp: #0f7a63;
  --whatsapp-dark: #0b6350;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(10, 27, 42, 0.04), 0 12px 32px -12px rgba(10, 27, 42, 0.12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Noto Sans Arabic", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;   /* stop iOS inflating text in landscape */
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;               /* never allow sideways scroll */
}

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

h1, h2, h3 { color: var(--ink); line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }

img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---- Layout ------------------------------------------------------------ */

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.wrap-narrow { max-width: 760px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header__actions { display: flex; align-items: center; gap: 16px; }
.site-header__link {
  display: none;
  font-size: 14px; font-weight: 500;
  color: var(--ink-muted); text-decoration: none;
}
.site-header__link:hover { color: var(--brand-700); }
.lang-toggle {
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 10px; font-size: 13px; font-weight: 500;
  color: var(--ink-soft); text-decoration: none; white-space: nowrap;
}
.lang-toggle:hover { border-color: var(--brand-600); color: var(--brand-700); }
.logo { width: 176px; height: auto; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: auto; }
.site-footer__inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding-block: 32px; text-align: center;
}
.site-footer__links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 20px; font-size: 13px;
}
.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand-700); }

/* The logo's blue-to-lime sweep, as a hairline. */
.brand-rule {
  height: 2px; width: 100%;
  background-image: linear-gradient(90deg,
    var(--brand-600) 0%, var(--brand-cyan) 34%, var(--brand-teal) 55%,
    var(--brand-green) 74%, var(--brand-lime) 100%);
}

/* ---- Hero -------------------------------------------------------------- */

.hero { padding-block: 28px 56px; }
.hero__grid { display: grid; gap: 40px; }
.hero__col { min-width: 0; }   /* stops inputs' intrinsic width widening the grid */

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brand-600);
}
.hero h1 {
  margin-top: 12px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 600; letter-spacing: -0.025em;
}
.hero__sub {
  margin-top: 16px; max-width: 34rem;
  font-size: 16px; line-height: 1.65; color: var(--ink-soft);
}
.pills { display: none; flex-wrap: wrap; gap: 8px 10px; margin-top: 24px; padding: 0; list-style: none; }
.pills li {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
}

/* ---- Card & form ------------------------------------------------------- */

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.card__title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.card__intro { margin-top: 6px; margin-bottom: 20px; font-size: 14px; color: var(--ink-muted); }

.field { margin-bottom: 14px; }
.field__label {
  display: block; margin-bottom: 6px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
}
.field__optional { margin-inline-start: 6px; font-weight: 400; color: var(--ink-muted); }

.input, .select {
  width: 100%;
  min-width: 0;                 /* form controls must not force the layout wide */
  padding: 14px;
  font: inherit;
  font-size: 16px;              /* below 16px iOS zooms on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: rgba(90, 107, 123, 0.7); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(0, 92, 180, 0.15);
}
.input[aria-invalid="true"] { border-color: var(--danger); }

.select-wrap { position: relative; }
.select {
  appearance: none;
  padding-inline-end: 40px;
  cursor: pointer;
}
.select--placeholder { color: rgba(90, 107, 123, 0.8); }
.select-wrap__chevron {
  position: absolute; inset-block: 0; inset-inline-end: 14px;
  margin-block: auto; width: 14px; height: 14px;
  color: var(--ink-muted); pointer-events: none;
}

/* Phone: country selector + number, number always LTR */
.phone {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.phone:focus-within {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(0, 92, 180, 0.15);
}
.phone[data-invalid="true"] { border-color: var(--danger); }
.phone__country {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  padding-inline: 12px 4px;
  background: var(--surface-sunken);
  border-inline-end: 1px solid var(--line);
}
.phone__flag { font-size: 18px; line-height: 1; }
.phone__dial { font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.phone__chevron { width: 12px; height: 12px; color: var(--ink-muted); }
/* The real control sits invisibly on top so the OS picker opens on tap. */
.phone__select {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 16px;
}
.phone__input {
  flex: 1; min-width: 0;
  padding: 14px 12px;
  border: 0; outline: none;
  font: inherit; font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  text-align: start;
}

.field__error { margin-top: 6px; font-size: 14px; color: var(--danger); }

.link-button {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 14px; font-weight: 500;
  color: var(--brand-700); cursor: pointer;
}
.link-button:hover { color: var(--brand-900); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px; padding-inline: 24px;
  font: inherit; font-size: 17px; font-weight: 600;
  color: #fff; background: var(--brand-600);
  border: 0; border-radius: var(--radius); cursor: pointer;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--brand-700); }
.btn:disabled { background: rgba(0, 92, 180, 0.7); cursor: not-allowed; }

.btn--whatsapp { background: var(--whatsapp); text-decoration: none; }
.btn--whatsapp:hover { background: var(--whatsapp-dark); }
.btn--secondary {
  height: 48px; font-size: 15px;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line-strong); text-decoration: none;
}
.btn--secondary:hover { border-color: var(--brand-600); color: var(--brand-700); }

.form__note { margin-top: 12px; text-align: center; font-size: 13px; color: var(--ink-muted); }
.form__consent {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.6; color: var(--ink-muted);
}
.form__consent a { color: var(--ink-soft); }

.alert {
  border: 1px solid rgba(180, 35, 24, 0.25);
  background: var(--danger-bg);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.alert__title { font-size: 15px; font-weight: 500; color: var(--danger); }
.alert a { display: inline-block; margin-top: 8px; font-weight: 600; color: var(--brand-700); }

.spinner { width: 18px; height: 18px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Honeypot — off-screen, never seen by a real user. */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ---- Sections ---------------------------------------------------------- */

.section { padding-block: 56px; }
.section--bordered { background: var(--surface); border-block: 1px solid var(--line); }
.section__title {
  text-align: center; font-size: 1.5rem;
  font-weight: 600; letter-spacing: -0.02em;
}

.trust { display: grid; gap: 28px 32px; padding: 0; list-style: none; }
.trust li { display: flex; gap: 12px; }
.trust__icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; color: var(--brand-600); }
.trust h3 { font-size: 15px; font-weight: 600; }
.trust p { margin-top: 4px; font-size: 14px; color: var(--ink-muted); }

.modules {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  max-width: 900px; margin: 32px auto 0; padding: 0; list-style: none;
}
.modules li {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 12px 16px;
  text-align: center; font-size: 14px; font-weight: 500; color: var(--ink-soft);
}

.specialties { max-width: 900px; margin: 48px auto 0; text-align: center; }
.specialties h3 { font-size: 15px; font-weight: 600; }
.specialties ul {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin-top: 16px; padding: 0; list-style: none;
}
.specialties li {
  background: var(--surface-sunken); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; color: var(--ink-muted);
}

/* ---- Thank you --------------------------------------------------------- */

.confirm { width: 100%; max-width: 36rem; margin-inline: auto; }
.confirm__icon { width: 48px; height: 48px; color: var(--brand-600); }
.confirm h1 { margin-top: 20px; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; }
.confirm__lead { margin-top: 8px; font-size: 17px; font-weight: 500; color: var(--ink-soft); }
.confirm__body { margin-top: 16px; font-size: 15px; color: var(--ink-muted); }
.confirm__ref {
  margin-top: 24px; padding: 12px 16px;
  background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 14px; color: var(--ink-muted);
}
.confirm__ref strong { color: var(--ink); font-weight: 600; letter-spacing: 0.02em; user-select: all; }
.confirm__actions { margin-top: 28px; display: grid; gap: 12px; }
.confirm__note { margin-top: 20px; text-align: center; font-size: 13px; color: var(--ink-muted); }

/* Machine identifiers read left-to-right even on the Arabic page. */
[dir="ltr"], .ltr { direction: ltr; }
.confirm__ref strong, .phone__dial { unicode-bidi: isolate; }

/* ---- Legal pages ------------------------------------------------------- */

.legal { padding-block: 48px; }
.legal h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.025em; }
.legal__updated { margin-top: 8px; font-size: 14px; color: var(--ink-muted); }
.legal__body { margin-top: 32px; display: grid; gap: 28px; font-size: 15px; line-height: 1.7; }
.legal__body h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.legal__body p + p { margin-top: 12px; }
.legal__body ul { margin: 12px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.legal__back { display: inline-block; margin-top: 48px; font-weight: 600; color: var(--brand-700); }

/* ---- Responsive -------------------------------------------------------- */

@media (min-width: 640px) {
  .wrap { padding-inline: 32px; }
  .hero { padding-block: 64px; }
  .hero__sub { font-size: 18px; }
  .pills { display: flex; }
  .site-header__link { display: inline; }
  .card { padding: 28px; }
  .site-footer__inner { flex-direction: row; justify-content: space-between; align-items: flex-start; text-align: start; }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section__title { font-size: 1.75rem; }
  .confirm h1 { font-size: 2rem; }
}

@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) 460px; gap: 64px; }
  .hero__col--text { padding-top: 24px; }
  .trust { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modules { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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