:root {
  --bg: #020601;
  --bg-raise: #07120a;
  --mint: #6ae499;
  --mint-soft: #92ebb4;
  --mint-tint: rgba(106, 228, 153, 0.15);
  --mint-line: rgba(106, 228, 153, 0.28);
  --text: #f2f7f3;
  --text-dim: rgba(242, 247, 243, 0.66);
  --text-faint: rgba(242, 247, 243, 0.42);
  --line: rgba(255, 255, 255, 0.09);
  --danger: #ff8a7a;

  --font: 'Sora', 'Noto Sans Arabic', system-ui, sans-serif;
  --radius-pill: 100px;
  --radius-card: 22px;
  --radius-input: 12px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 220ms;

  color-scheme: dark;
}

:root[lang='ar'] { --font: 'Noto Sans Arabic', 'Sora', system-ui, sans-serif; }

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

[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

/* Atmosphere: mint glows, a faint measurement grid, and grain */
.atmos {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60vmax 40vmax at 78% 18%, rgba(106, 228, 153, 0.16), transparent 60%),
    radial-gradient(50vmax 36vmax at 8% 96%, rgba(106, 228, 153, 0.09), transparent 62%),
    var(--bg);
}
.atmos::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 10%, transparent 75%);
  opacity: 0.55;
}
.atmos::after {
  content: ''; position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: 0.06; mix-blend-mode: overlay;
}

.shell {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 1180px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.brand { color: var(--text); display: inline-flex; border-radius: 6px; }
.brand svg { width: 112px; height: auto; display: block; }
.lang-toggle {
  min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--mint-line);
  background: rgba(2, 6, 1, 0.6); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer;
  transition: border-color var(--dur), background var(--dur), transform var(--dur) var(--ease-out);
}
.lang-toggle:hover { border-color: var(--mint); background: var(--mint-tint); }
.lang-toggle:active { transform: scale(0.94); }
.lang-toggle[data-target='ar'] { font-family: 'Noto Sans Arabic', sans-serif; font-size: 17px; }

/* Stage */
.stage {
  flex: 1; display: grid; gap: 18px;
  align-content: center; padding-top: 10px;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 5px 12px 5px 10px;
  border: 1px solid var(--mint-line); border-radius: var(--radius-pill);
  background: var(--mint-tint); color: var(--mint-soft);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 var(--mint); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(106, 228, 153, 0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(106, 228, 153, 0); } }

h1 {
  margin: 0; font-weight: 600;
  font-size: clamp(26px, 6.4vw, 54px); line-height: 1.12; letter-spacing: -0.025em;
  text-wrap: balance;
}
:root[lang='ar'] h1 { letter-spacing: 0; line-height: 1.3; font-weight: 700; }
h1 .hl, .hl { color: var(--mint); }

.sub { margin: 8px 0 0; color: var(--text-dim); font-size: clamp(14px, 1.4vw, 17px); max-width: 34em; }

.proof { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-faint); font-size: 12.5px; }
.proof li { display: inline-flex; align-items: baseline; gap: 5px; }
.proof li::before {
  content: ''; width: 14px; height: 14px; align-self: center; flex: none; background: var(--mint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.proof strong { color: var(--mint-soft); font-weight: 600; font-size: 14px; }

/* Card */
.card {
  position: relative; border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(14, 30, 19, 0.82), rgba(5, 12, 7, 0.9));
  border: 1px solid var(--mint-line);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 30px 80px -30px rgba(106, 228, 153, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

.steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps li { font-size: 11.5px; color: var(--text-faint); font-weight: 600; }
.steps li::before {
  content: ''; display: block; height: 3px; border-radius: 3px; margin-bottom: 6px;
  background: linear-gradient(90deg, var(--mint), var(--mint-soft)) no-repeat, var(--line);
  background-size: 0% 100%, 100% 100%;
  transition: background-size 420ms var(--ease-out);
}
:root[dir='rtl'] .steps li::before { background-position: right, 0 0; }
.steps li.is-active, .steps li.is-done { color: var(--text); }
.steps li.is-active::before, .steps li.is-done::before { background-size: 100% 100%, 100% 100%; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.step.is-active { animation: stepIn 360ms var(--ease-out); }
@keyframes stepIn { from { opacity: 0; transform: translateX(var(--step-shift, 14px)); } to { opacity: 1; transform: none; } }
:root[dir='rtl'] { --step-shift: -14px; }
.step.is-back { --step-shift: -14px; }
:root[dir='rtl'] .step.is-back { --step-shift: 14px; }

.field { margin-bottom: 8px; }
.field > label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 5px; }

input[type='text'], input[type='tel'], input[type='email'], select {
  width: 100%; height: 44px; padding: 0 14px;
  border-radius: var(--radius-input); border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35); color: var(--text);
  font: 400 15px/1 var(--font);
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
input::placeholder { color: var(--text-faint); }
:root[dir='rtl'] input[dir='ltr'] { text-align: right; }
input:hover, select:hover { border-color: rgba(255, 255, 255, 0.18); }
input:focus, select:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-tint); background: rgba(0, 0, 0, 0.5); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field.has-error input:focus { box-shadow: 0 0 0 3px rgba(255, 138, 122, 0.18); }

.phone { display: grid; grid-template-columns: 112px 1fr; gap: 8px; }
.phone select { padding: 0 10px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) 19px, calc(100% - 10px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
:root[dir='rtl'] .phone input { text-align: left; }

.err { min-height: 0; margin: 4px 0 0; font-size: 12px; color: var(--danger); }
.err:empty { display: none; }

/* Choice controls */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.chip, .tile { position: relative; cursor: pointer; }
.chip input, .tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span, .tile span {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--text-dim);
  font-size: 13.5px; font-weight: 600;
  transition: border-color var(--dur), background var(--dur), color var(--dur), transform var(--dur) var(--ease-out);
}
.chip span { height: 36px; padding: 0 14px; border-radius: var(--radius-pill); }
.tile span { height: 42px; padding: 0 10px; border-radius: var(--radius-input); }
.chip:hover span, .tile:hover span { border-color: rgba(255, 255, 255, 0.22); color: var(--text); }
.chip input:active + span, .tile input:active + span { transform: scale(0.97); }
.chip input:checked + span, .tile input:checked + span {
  border-color: var(--mint); background: var(--mint-tint); color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(106, 228, 153, 0.35);
}
.chip input:focus-visible + span, .tile input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }
.field.has-error .chip span, .field.has-error .tile span { border-color: rgba(255, 138, 122, 0.5); }

.tiles.wrap span { height: auto; min-height: 42px; padding: 6px 8px; font-size: 12.5px; line-height: 1.3; text-align: center; }
.other-box { margin-top: 6px; }
.other-box input { height: 40px; }

/* Honeypot */
/* Clipped in place: an off-screen offset would create sideways scroll in RTL */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

/* Buttons */
.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: var(--radius-pill);
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur), background var(--dur), border-color var(--dur), opacity var(--dur);
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .brand:focus-visible, .lang-toggle:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.btn.primary {
  flex: 1; color: var(--text);
  background: linear-gradient(180deg, #0f2a19, #071209);
  border: 1px solid var(--mint);
  box-shadow: 0 0 24px -6px rgba(106, 228, 153, 0.55), inset 0 1px 0 rgba(146, 235, 180, 0.25);
}
.btn.primary:hover { box-shadow: 0 0 34px -4px rgba(106, 228, 153, 0.7), inset 0 1px 0 rgba(146, 235, 180, 0.35); background: linear-gradient(180deg, #13341f, #08160b); }
.btn.primary[disabled] { opacity: 0.6; cursor: progress; }
.btn.ghost { border: 1px solid var(--line); background: transparent; color: var(--text-dim); }
.btn.ghost:hover { border-color: rgba(255, 255, 255, 0.24); color: var(--text); }
.arrow { display: inline-block; transition: transform var(--dur) var(--ease-out); }
.btn.primary:hover .arrow { transform: translateX(3px); }
:root[dir='rtl'] .arrow { transform: scaleX(-1); }
:root[dir='rtl'] .btn.primary:hover .arrow { transform: scaleX(-1) translateX(3px); }

.form-msg { margin: 8px 0 0; font-size: 13px; color: var(--danger); text-align: center; }
.form-msg:empty { display: none; }
.fine { margin: 8px 0 0; font-size: 11.5px; color: var(--text-faint); text-align: center; }

/* Success */
.done { text-align: center; padding: 22px 6px 8px; outline: none; }
.done h2 { margin: 14px 0 6px; font-size: 24px; font-weight: 600; }
.done p { margin: 0 auto 18px; color: var(--text-dim); max-width: 26em; }
.done-mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--mint-tint); box-shadow: 0 0 40px -6px rgba(106, 228, 153, 0.6); }
.done-mark svg { width: 64px; height: 64px; fill: none; stroke: var(--mint); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.done-mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 700ms var(--ease-out) forwards; }
.done-mark path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw 420ms 520ms var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Page-load reveal */
.reveal { animation: rise 700ms var(--ease-out) both; animation-delay: calc(var(--d, 0) * 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Desktop */
@media (min-width: 900px) {
  .shell { padding: 28px 40px; }
  .brand svg { width: 140px; }
  .stage { grid-template-columns: 1.08fr 0.92fr; gap: 64px; align-items: center; padding-top: 0; }
  .eyebrow { margin-bottom: 22px; font-size: 13px; }
  .sub { margin-top: 18px; }
  .proof { margin-top: 30px; gap: 10px 22px; font-size: 14px; }
  .proof strong { font-size: 18px; }
  .card { padding: 26px; }
  .steps { margin-bottom: 22px; }
  .steps li { font-size: 12.5px; }
  .field { margin-bottom: 12px; }
  .actions { margin-top: 18px; }
}

/* Phones: size tiles sit 4-across and the sub line steps aside after step 1, so step 3 fits without scrolling */
@media (max-width: 899px) {
  .tiles:not(.wrap) { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .tiles:not(.wrap) span { height: auto; min-height: 40px; padding: 4px 3px; font-size: 12px; line-height: 1.2; text-align: center; }
  :root[data-step='2'] .sub, :root[data-step='3'] .sub { display: none; }
}

/* Short mobile screens: tighten so the form still fits without scrolling */
@media (max-width: 899px) and (max-height: 700px) {
  .sub { display: none; }
  .stage { gap: 12px; }
}

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