:root {
  --navy: #0e212e;
  --navy-2: #1b3547;
  --orange: #f47b20;
  --orange-d: #d9650f;
  --orange-soft: #fff1e5;
  --paper: #fff;
  --bg: #f6f3ee;
  --line: #e8e2d9;
  --soft: #faf7f2;
  --muted: #6b7783;
  --danger: #b54747;
  --shadow: 0 18px 50px rgba(14, 33, 46, 0.1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: "IBM Plex Sans Arabic", sans-serif;
  line-height: 1.7;
}
button,
input,
select,
textarea {
  font: inherit;
}
.hidden {
  display: none !important;
}

/* top bar + header */
.topbar {
  height: 6px;
  background: linear-gradient(90deg, var(--orange), var(--navy));
}
.shell {
  width: min(100% - 32px, 920px);
  margin: 34px auto 70px;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.brand {
  display: block;
  line-height: 0;
}
.brand img {
  height: 40px;
  width: auto;
  display: block;
}
.secure {
  font-size: 12px;
  font-weight: 500;
  color: var(--navy-2);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  border-radius: 26px;
  padding: 40px 38px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.hero:after {
  content: "";
  position: absolute;
  inset-inline-start: -70px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--orange);
  opacity: 0.18;
}
.eyebrow {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.35;
}
.hero p {
  position: relative;
  margin: 0 0 20px;
  max-width: 640px;
  color: #c9d3db;
  font-size: 15px;
}
.hero-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-meta span {
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 4px 12px;
  border-radius: 999px;
}

/* progress */
.progress-card,
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.progress-card {
  position: sticky;
  top: 10px;
  z-index: 20;
  border-radius: 20px;
  padding: 18px 22px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}
.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
#stepName {
  font-weight: 700;
  font-size: 14px;
}
.progress-number {
  font-weight: 700;
  color: var(--orange-d);
}
.progress-track {
  height: 8px;
  background: #efe9df;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 25%;
  min-width: 8%;
  background: linear-gradient(90deg, var(--orange), #ffa05c);
  border-radius: inherit;
  transition: width 0.4s;
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.step-dot {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
.step-dot b {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #efe9df;
  color: var(--navy-2);
  font-size: 12px;
}
.step-dot.active {
  color: var(--navy);
  font-weight: 700;
}
.step-dot.active b {
  background: var(--orange);
  color: #fff;
}
.step-dot.done b {
  background: var(--navy);
  color: #fff;
}

/* form */
.form-card {
  border-radius: 24px;
  padding: 34px 34px 28px;
}
.section-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-d);
  letter-spacing: 0.3px;
}
h2 {
  margin: 4px 0 6px;
  font-size: 26px;
}
.section-desc {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}
.question {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.question:first-of-type {
  border-top: 0;
}
.q-title {
  margin: 0 0 14px;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.q-num {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
}
.hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--orange-d);
  background: var(--orange-soft);
  padding: 1px 10px;
  border-radius: 999px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.choice {
  position: relative;
  cursor: pointer;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 14px;
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  transition: 0.18s;
}
.choice span:before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid #c9c1b4;
  border-radius: 50%;
  background: #fff;
  transition: 0.18s;
}
.choice input[type="checkbox"] + span:before {
  border-radius: 6px;
}
.choice:hover span {
  border-color: var(--orange);
  background: #fff;
}
.choice:has(input:checked) span {
  background: var(--orange-soft);
  border-color: var(--orange);
  font-weight: 600;
}
.choice input:checked + span:before {
  border-color: var(--orange);
  background: var(--orange) radial-gradient(#fff 0 32%, transparent 36%);
}
.choice input[type="checkbox"]:checked + span:before {
  background: var(--orange)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}
.choice input:focus-visible + span {
  outline: 3px solid rgba(244, 123, 32, 0.4);
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.follow-up {
  margin-top: 14px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--navy);
  outline: none;
  transition: 0.18s;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(244, 123, 32, 0.15);
}
.notice {
  margin-top: 8px;
  padding: 14px 18px;
  background: var(--orange-soft);
  border-inline-start: 4px solid var(--orange);
  border-radius: 12px;
  font-size: 13px;
  color: var(--navy-2);
}
.error {
  display: none;
  margin-top: 16px;
  padding: 11px 16px;
  background: #fbeaea;
  color: var(--danger);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* buttons */
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 30px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 7px 16px rgba(14, 33, 46, 0.22);
}
.btn-primary:hover {
  background: var(--navy-2);
  transform: translateY(-1px);
}
.btn-done {
  background: var(--orange);
  color: #fff;
  min-width: 150px;
  box-shadow: 0 8px 18px rgba(244, 123, 32, 0.35);
}
.btn-done:hover {
  background: var(--orange-d);
  transform: translateY(-1px);
}
.btn-ghost {
  background: #f1ece3;
  color: var(--navy-2);
}
.btn-ghost:hover {
  background: #e8e1d5;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* success + footer */
.success {
  text-align: center;
  padding: 44px 10px;
}
.success-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 26px;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 38px;
  box-shadow: 0 10px 24px rgba(244, 123, 32, 0.35);
}
.success h2 {
  font-size: 26px;
  margin-bottom: 8px;
}
.success p {
  color: var(--muted);
  font-size: 14px;
  max-width: 460px;
  margin: 0 auto;
}
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 22px 0;
}
.footer strong {
  color: var(--orange-d);
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 920px);
    margin: 20px auto 40px;
  }
  .brand img {
    height: 28px;
  }
  .hero {
    padding: 26px 20px;
    border-radius: 20px;
  }
  .form-card {
    padding: 22px 17px;
    border-radius: 18px;
  }
  .grid,
  .fields {
    grid-template-columns: 1fr;
  }
  .progress-card {
    top: 6px;
    padding: 12px 14px;
  }
  .steps {
    gap: 4px;
    margin-top: 10px;
  }
  .step-dot {
    font-size: 9px;
    gap: 4px;
    flex-direction: column;
    text-align: center;
  }
  .secure {
    font-size: 10px;
    padding: 4px 10px;
  }
  .actions .btn {
    padding: 12px 18px;
  }
}

/* autocomplete (wilaya / commune) */
.combo {
  position: relative;
}
.combo-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--paper);
  border: 1.5px solid var(--orange);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.combo-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}
.combo-list li small {
  color: var(--muted);
  font-size: 11px;
  direction: ltr;
}
.combo-list li:hover,
.combo-list li.active {
  background: var(--orange-soft);
}
.combo-list li.empty {
  color: var(--muted);
  cursor: default;
}
.combo-list li.empty:hover {
  background: none;
}

/* icons (replace emoji) */
.ico {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.secure,
.eyebrow,
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.step-dot b .ico {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}
.success-icon .ico {
  width: 40px;
  height: 40px;
  stroke-width: 3;
}
.btn-done .ico {
  stroke-width: 3;
}

/* header tools + language switch */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.18s;
}
.lang-btn:hover {
  border-color: var(--orange);
  color: var(--orange-d);
}
/* French = left-to-right: flip the direction arrows and keep Arabic names readable */
[dir="ltr"] #prevBtn .ico,
[dir="ltr"] #nextBtn .ico {
  transform: scaleX(-1);
}
[dir="ltr"] .combo-list li small {
  direction: rtl;
}
@media (max-width: 640px) {
  .header-tools {
    gap: 6px;
  }
  .lang-btn {
    padding: 4px 11px;
    font-size: 11px;
  }
}
