/* ==========================================================================
   IDARATI landing page
   Brand primary mirrors the main app: hsl(210 79% 46%) -> #1975D2
   ========================================================================== */

:root {
  --primary: #1975d2;
  --primary-dark: #145ba8;
  --primary-light: #e8f1fb;

  --ink: #0f1b2d;
  --body: #4a5568;
  --muted: #718096;
  --line: #e2e8f0;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;

  --danger: #d92d20;
  --success: #067647;
  --success-bg: #ecfdf3;
  --danger-bg: #fef3f2;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06);
  --shadow-md: 0 4px 16px rgba(15, 27, 45, .08);
  --shadow-lg: 0 18px 48px rgba(15, 27, 45, .12);

  --container: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .18s ease, box-shadow .18s ease, transform .06s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-primary:disabled {
  background: #9dbfe4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-block { width: 100%; }

.btn:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand-logo { height: 36px; width: auto; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-nav a {
  color: var(--body);
  font-weight: 500;
  font-size: 15px;
}
.header-nav a:hover { color: var(--primary); }
.header-nav a.btn { color: #fff; }

/* --- Language switcher -------------------------------------------------- */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-switch button {
  min-width: 38px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.lang-switch button:hover { color: var(--ink); }

.lang-switch button.is-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.lang-switch button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* The Arabic glyph is short and sits differently on the baseline. */
.lang-switch button[lang="ar"] { font-size: 15px; }

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

.hero {
  background:
    radial-gradient(1000px 460px at 12% -10%, var(--primary-light), transparent 60%),
    linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
  padding: 72px 0 88px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: start;
}

.badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #cfe2f7;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  margin-bottom: 20px;
}

.lede {
  font-size: 18px;
  max-width: 34em;
  margin-bottom: 28px;
}

.trust-list {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15.5px;
  color: var(--ink);
}

.trust-list svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  padding: 3px;
  border-radius: 50%;
  background: var(--primary-light);
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 26px; color: var(--ink); font-weight: 700; line-height: 1.2; }
.stat span { font-size: 14px; color: var(--muted); }

/* --- Form card ---------------------------------------------------------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: sticky;
  top: 92px;
}

.form-card-head { margin-bottom: 24px; }
.form-card-head h2 { font-size: 22px; margin-bottom: 6px; }
.form-card-head p { font-size: 14.5px; color: var(--muted); margin: 0; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.req { color: var(--danger); }
.optional { color: var(--muted); font-weight: 400; }

.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input::placeholder { color: #a0aec0; }

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 117, 210, .14);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}
.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, .14);
}

.error {
  display: none;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--danger);
}
.error.visible { display: block; }

/* Honeypot — hidden from humans but not via display:none, which some bots skip */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.form-status {
  display: none;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
}
.form-status.visible { display: block; }
.form-status.success {
  background: var(--success-bg);
  border-color: #abefc6;
  color: var(--success);
}
.form-status.error {
  background: var(--danger-bg);
  border-color: #fecdc9;
  color: var(--danger);
}

/* Submit spinner */
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

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

.section { padding: 88px 0; }
.section-alt { background: var(--surface-alt); }

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}
.section-head h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
.section-head p { font-size: 17px; margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 14.5px; margin: 0; }

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.card-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Steps -------------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: 14.5px; margin: 0; }

.step-num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
}

.section-cta { text-align: center; margin-top: 48px; }

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: #a9b6c8;
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-logo {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
}
.site-footer p { margin: 0; font-size: 14px; }

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

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .form-card { position: static; }
  .hero { padding: 56px 0 64px; }
}

@media (max-width: 640px) {
  .header-nav { gap: 16px; }
  .header-nav a:not(.btn) { display: none; }
  .section { padding: 64px 0; }
  .form-card { padding: 24px 20px; }
  .stats { gap: 28px; }
  .footer-inner { justify-content: center; text-align: center; }
}

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

/* --- RTL (Arabic) -------------------------------------------------------
   The layout is flex/grid with logical gaps, so direction is handled by the
   browser once dir="rtl" is set. Only the genuinely direction-specific bits
   need overriding. */

[dir="rtl"] body {
  /* Prefer a proper Arabic face where one exists; the Latin stack still
     applies to Latin runs such as email addresses and "SARL". */
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Geeza Pro", Arial, sans-serif;
}

/* Slightly more line height — Arabic diacritics and descenders need the room. */
[dir="rtl"] .lede,
[dir="rtl"] .trust-list li,
[dir="rtl"] .card p,
[dir="rtl"] .step p { line-height: 1.75; }

/* Latin-tuned negative tracking looks wrong on Arabic letterforms. */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 { letter-spacing: 0; }

/* The honeypot is positioned off-screen; in RTL, `left` would push it into
   view on wide viewports, so flip it to the inline-start edge instead. */
[dir="rtl"] .hp-field { left: auto; right: -9999px; }

/* Email and phone stay LTR even in an RTL page — the inputs already carry
   dir="ltr", this keeps their placeholders aligned to the left edge. */
[dir="rtl"] input[dir="ltr"] { text-align: left; }

/* Numerals read left-to-right; without this the "+" in "1000+" can land on
   the wrong side. */
[dir="rtl"] .stat strong { direction: ltr; unicode-bidi: embed; }
