:root {
  --primary: #1DA1F2;
  --primary-dark: #0d8bdc;
  --primary-deep: #0a72b8;
  --secondary: #FFA500;
  --bg: #f4f7fb;
  --text: #102a43;
  --text-soft: #334e63;
  --muted: #6b7f92;
  --border: #cfd9e4;
  --border-soft: #e2e8f0;
  --input-bg: #fcfdfe;
  --error: #ef4444;
  --success: #16a34a;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-card: 0 12px 40px rgba(16, 42, 67, 0.08), 0 3px 10px rgba(16, 42, 67, 0.05);
  --ring: 0 0 0 4px rgba(29, 161, 242, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Inter", "Tajawal", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(29, 161, 242, 0.16), transparent 60%),
    radial-gradient(900px 480px at 0% 100%, rgba(255, 165, 0, 0.10), transparent 55%),
    linear-gradient(180deg, #f7fafe 0%, #eef4fb 60%, #f4f7fb 100%);
  background-attachment: fixed;
}

body.rtl { font-family: "Tajawal", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* Brand gradient bar */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 50;
}

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 34px 16px 132px;
}

/* ── Loading skeleton (shown until the form data arrives) ── */
.skeleton { display: none; }
body.loading .skeleton { display: block; }
body.loading .header,
body.loading #form { display: none; }

.skeleton-head { text-align: center; margin-bottom: 26px; }
.skeleton-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
}
.skeleton-bar {
  background: #e7ecf3;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.skeleton-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.sk-title { height: 26px; width: 60%; margin: 0 auto 10px; }
.sk-subtitle { height: 14px; width: 42%; margin: 0 auto 16px; }
.sk-chips { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.sk-chip { height: 26px; width: 92px; border-radius: 999px; }
.sk-progress { height: 6px; margin-bottom: 22px; }
.sk-field { margin-bottom: 24px; }
.sk-label { height: 14px; width: 45%; margin-bottom: 9px; }
.sk-input { height: 44px; width: 100%; }
.sk-cta { height: 51px; width: 100%; border-radius: var(--radius-sm); }

/* ── Header / hero ─────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: 26px;
  animation: fadeUp 0.6s var(--ease) both;
}

.lang-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 3px;
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.06);
  backdrop-filter: blur(6px);
}
.lang-toggle button {
  border: none;
  background: transparent;
  padding: 8px 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  border-radius: 999px;
  transition: all 0.2s ease;
}
.lang-toggle button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29, 161, 242, 0.3);
}

h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.header p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* Trust chips */
.trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.05);
}

/* ── Form card ─────────────────────────────────────────── */
#form {
  background: var(--card, #fff);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 30px 26px 26px;
  box-shadow: var(--shadow-card);
  position: relative;
  /* opacity-only fade: a retained transform would make #form a stacking context
     and trap the open city dropdown below later siblings. */
  animation: fadeIn 0.6s var(--ease) 0.08s both;
}
#form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0.9;
}

.field {
  margin-bottom: 24px;
  /* opacity-only fade: a transform here would give each field its own stacking
     context and make later fields paint OVER the open city dropdown. */
  animation: fadeIn 0.35s var(--ease) both;
}

/* Progress indicator */
.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.4s var(--ease);
}
.progress-pct {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 36px;
  text-align: end;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 9px;
  color: var(--text);
  transition: color 0.18s;
}
.req-star { color: var(--secondary); font-weight: 800; }

.field-desc {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Inputs */
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="email"],
select,
textarea,
.searchable-input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input:focus, select:focus, textarea:focus, .searchable-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: #a4b3c2; font-weight: 400; }

/* Invalid field highlight (red border on the control itself, not just text) */
.field-invalid input[type="text"],
.field-invalid input[type="tel"],
.field-invalid input[type="number"],
.field-invalid input[type="email"],
.field-invalid select,
.field-invalid textarea,
.field-invalid .searchable-input {
  border-color: var(--error);
}
.field-invalid input:focus,
.field-invalid select:focus,
.field-invalid textarea:focus,
.field-invalid .searchable-input:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}
.field-invalid .field-label { color: var(--error); }
.field-invalid .field-error { color: var(--error); }

/* Valid field highlight — green label (and green border on typed inputs) as
   positive feedback once a field is filled correctly. Mirrors the red rules above. */
.field-valid input[type="text"],
.field-valid input[type="tel"],
.field-valid input[type="number"],
.field-valid input[type="email"],
.field-valid select,
.field-valid textarea,
.field-valid .searchable-input {
  border-color: var(--success);
}
.field-valid input:focus,
.field-valid select:focus,
.field-valid textarea:focus,
.field-valid .searchable-input:focus {
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}
.field-valid .field-label { color: var(--success); }

/* Saudi flag in the phone input (E.164 +966 is stored server-side) */
.field[data-key="phone"] input { padding-inline-start: 44px; background-image: url("/saudi-flag.svg?v=1"); background-repeat: no-repeat; background-position: 13px center; background-size: 21px 14px; }

textarea { resize: vertical; min-height: 96px; }

/* ── File upload (vendor registration documents) ────────── */
.file-upload { display: flex; flex-direction: column; gap: 8px; }
.file-upload-box {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--input-bg);
  transition: border-color 0.18s, background 0.18s;
}
.file-upload-box:hover { border-color: var(--primary); background: #fff; }
.file-upload-icon { font-size: 20px; }
.file-upload-text { font-size: 14px; font-weight: 600; color: var(--muted); }
.file-upload-list { display: flex; flex-direction: column; gap: 6px; }
.file-upload-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
  padding: 7px 11px; background: #f1f5f9; border-radius: 9px;
}
.file-upload-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-remove {
  flex: 0 0 auto; width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  font-size: 12px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.file-remove:hover { background: var(--error); color: #fff; }
.field-valid .file-upload-box { border-color: var(--success); }
.field-invalid .file-upload-box { border-color: var(--error); }

/* ── Checkbox / radio selectable cards ─────────────────── */
.checkbox-group, .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.checkbox-option, .radio-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  background: #fff;
  transition: border-color 0.18s, background 0.18s, transform 0.12s, box-shadow 0.18s;
  user-select: none;
}
.checkbox-option:hover, .radio-option:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(29, 161, 242, 0.08);
}
.checkbox-option:has(input:checked), .radio-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(29, 161, 242, 0.07);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(29, 161, 242, 0.14);
  animation: pop 0.28s var(--ease);
}
.checkbox-option:has(input:checked) { font-weight: 700; }

.checkbox-option input, .radio-option input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; flex: none; }
.checkbox-option input:disabled ~ span { opacity: 0.4; }
.checkbox-option:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }

/* ── Grouped checkbox: selected summary chips ──────────── */
.checkbox-group { align-items: flex-start; }
.choice-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  margin-bottom: 10px;
}
.choice-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(29, 161, 242, 0.12);
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  animation: pop 0.25s var(--ease);
}
.choice-tag::after {
  content: "×";
  margin-inline-start: 8px;
  font-weight: 800;
  opacity: 0.65;
}
.choice-tag:hover { background: rgba(29, 161, 242, 0.22); }

.choice-groups { width: 100%; }

/* Accordion groups */
.choice-group {
  border: 1.5px solid var(--border);
  border-radius: 13px;
  margin-bottom: 9px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.18s;
}
.choice-group[open] { border-color: rgba(29, 161, 242, 0.45); }
.choice-group summary {
  cursor: pointer;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 11px;
  user-select: none;
}
.choice-group summary::-webkit-details-marker { display: none; }
.choice-group summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 13px;
  transition: transform 0.2s var(--ease);
}
.choice-group[open] summary::before { transform: rotate(90deg); }
.choice-group[open] summary { border-bottom: 1px solid var(--border-soft); }

.choice-group-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, rgba(29, 161, 242, 0.12), rgba(255, 165, 0, 0.12));
}
.choice-group-label { flex: 1; }
.choice-group-count {
  font-size: 12px;
  min-width: 24px;
  text-align: center;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 700;
}
.choice-group-count:empty { background: var(--border-soft); color: var(--muted); }
.choice-group-has-selection { border-color: var(--primary); }
.choice-group-body {
  padding: 8px 12px 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Multi-select dropdown (compact trigger + grouped popover) ── */
.ms-trigger {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  text-align: start;
  color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.ms-trigger:hover, .ms-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(29, 161, 242, 0.10);
}
.ms-trigger .ms-placeholder { color: var(--muted); }
.ms-chevron {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s var(--ease);
}
.ms-trigger[aria-expanded="true"] .ms-chevron { transform: rotate(180deg); }

.ms-panel {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow-y: auto;
  max-height: 320px;
  animation: fadeIn 0.18s var(--ease);
}
.ms-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 1;
}
/* Full-width flat rows inside the dropdown (overrides the card style) */
.ms-panel .checkbox-option {
  width: 100%;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #f1f5f9;
  padding: 11px 14px;
  background: #fff;
  justify-content: flex-start;
}
.ms-panel .checkbox-option:last-of-type { border-bottom: 0; }
.ms-panel .checkbox-option:hover {
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  transform: none;
  box-shadow: none;
}
.ms-panel .checkbox-option:has(input:checked) {
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(29, 161, 242, 0.07);
  box-shadow: none;
}
.ms-done {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 0 0 13px 13px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 -6px 14px rgba(15, 23, 42, 0.12);
}
.ms-done:hover { filter: brightness(1.05); }

/* ── Searchable select ─────────────────────────────────── */
.searchable-select { position: relative; }
.searchable-list {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline: 0;
  z-index: 9999;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 14px rgba(16, 42, 67, 0.08), 0 20px 44px rgba(16, 42, 67, 0.18);
  padding: 6px;
}
.searchable-list::-webkit-scrollbar { width: 8px; }
.searchable-list::-webkit-scrollbar-track { background: transparent; }
.searchable-list::-webkit-scrollbar-thumb {
  background: #c4d0dc;
  border-radius: 999px;
  border: 2px solid #fff;
}
.searchable-list::-webkit-scrollbar-thumb:hover { background: #aab8c8; }
.searchable-option {
  display: block;
  width: 100%;
  padding: 11px 12px;
  text-align: start;
  border: none;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
}
.searchable-option:hover { background: rgba(29, 161, 242, 0.08); }
.searchable-empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* ── Advanced (collapsed) section ──────────────────────── */
.advanced-section {
  margin: 6px 0 20px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
}
.advanced-section summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.advanced-section summary::-webkit-details-marker { display: none; }
.advanced-section summary::before {
  content: "▸";
  transition: transform 0.2s var(--ease);
  font-size: 13px;
}
.advanced-section[open] summary { color: var(--primary); }
.advanced-section[open] summary::before { transform: rotate(90deg); }
.advanced-body { padding-bottom: 16px; }

/* ── Notes collapsible (under phone) ───────────────────── */
.notes-section {
  margin: 4px 0 22px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: #fff;
}
.notes-section summary {
  cursor: pointer;
  padding: 13px 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notes-section summary::-webkit-details-marker { display: none; }
.notes-section summary::before {
  content: "▸";
  transition: transform 0.2s var(--ease);
  font-size: 13px;
}
.notes-section[open] summary { color: var(--primary); }
.notes-section[open] summary::before { transform: rotate(90deg); }
.notes-body { padding-bottom: 14px; }
.notes-body .field { margin-bottom: 0; }

/* ── Reassurance line ──────────────────────────────────── */
.reassure {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 18px;
}

/* ── CTA / submit ──────────────────────────────────────── */
.submit-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 15px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16.5px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 22px rgba(29, 161, 242, 0.32);
  transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
}
.submit-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 26px rgba(29, 161, 242, 0.4);
}
.submit-btn:active { transform: translateY(1px) scale(0.995); }
.submit-btn:disabled { opacity: 0.75; cursor: default; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}
.btn-spinner {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}

/* ── Sticky submit bar (CTA pinned to the bottom of the viewport) ── */
.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -6px 24px rgba(16, 42, 67, 0.08);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.sticky-bar-inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sticky-bar .submit-btn { width: 100%; }
.sticky-bar .validation-summary {
  margin-top: 0;
  padding: 11px 14px;
}
.sticky-bar .validation-summary-title {
  font-size: 13.5px;
  margin-bottom: 6px;
}
.sticky-bar .validation-summary ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 2px;
  padding-inline-start: 18px;
  font-size: 13px;
}
.sticky-bar .validation-summary li {
  margin-bottom: 0;
  list-style-position: inside;
}

/* ── Validation summary (under CTA) ────────────────────── */
.validation-summary {
  margin-top: 16px;
  border: 1.5px solid #f6c6c6;
  background: #fdf3f3;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  animation: fadeUp 0.3s var(--ease) both;
}
.validation-summary-title {
  font-weight: 700;
  font-size: 14.5px;
  color: #b23b3b;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.validation-summary ul {
  margin: 0;
  padding-inline-start: 20px;
  font-size: 13.5px;
  color: #7a2e2e;
}
.validation-summary li { margin-bottom: 3px; }

/* ── Success panel ─────────────────────────────────────── */
.success {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.6s var(--ease) both;
}
.success-icon { width: 84px; height: 84px; margin: 0 auto 20px; }
.checkmark { width: 84px; height: 84px; }
.checkmark circle {
  stroke: var(--primary);
  stroke-width: 3;
  stroke-dasharray: 152;
  stroke-dashoffset: 152;
  animation: drawCircle 0.6s var(--ease) forwards;
}
.checkmark path {
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
  animation: drawPath 0.4s var(--ease) 0.55s forwards;
}
.success h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.success p { margin: 0; color: var(--text-soft); }

/* "What happens next" heading + steps */
.steps-title {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  text-align: start;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.success-steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  text-align: start;
}
.success-steps.no-title {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.success-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
}
.success-step-num {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.success-step-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: linear-gradient(135deg, rgba(29, 161, 242, 0.12), rgba(255, 165, 0, 0.12));
}
.success-step-text { font-size: 14.5px; font-weight: 600; color: var(--text); }

/* Cross-sell ("هل تحتاج أيضاً؟") — bold + animated so it can't be missed */
.cross-sell {
  margin-top: 24px;
  border: 1.5px solid rgba(29, 161, 242, 0.35);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  text-align: start;
  background: linear-gradient(135deg, rgba(29, 161, 242, 0.08), rgba(255, 165, 0, 0.12));
  animation: crossIn 0.5s var(--ease) both;
}
.cross-sell-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--primary-deep);
  margin-bottom: 14px;
}
.cross-sell-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cross-sell-card {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(29, 161, 242, 0.32);
  animation: crossPop 0.5s var(--ease) both;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}
.cross-sell-card::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 45%;
  left: -60%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: crossShine 1.5s var(--ease) 0.9s both;
}
.cross-sell-card:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 26px rgba(29, 161, 242, 0.45);
  filter: brightness(1.06);
}
.cross-sell-icon { font-size: 18px; }
.cross-sell-label { white-space: nowrap; }

@keyframes crossIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes crossPop {
  0% { opacity: 0; transform: scale(0.5) translateY(10px); }
  60% { opacity: 1; transform: scale(1.1) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes crossShine {
  to { left: 130%; }
}

/* Confetti burst */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}
.confetti span {
  position: fixed;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  animation: confettiFly 1.3s var(--ease) forwards;
}
@keyframes confettiFly {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(720deg) scale(0.35); opacity: 0; }
}

/* ── Toast notification ─────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 18px);
  background: #102a43;
  color: #fff;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 12px 34px rgba(16, 42, 67, 0.32);
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
  max-width: calc(100% - 32px);
  text-align: center;
  line-height: 1.45;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--error); }

.hidden { display: none !important; }

/* ── Embed mode (?embed=1) ────────────────────────────────
   The hosting page shows the title/description, so hide them here (and their
   skeleton placeholders) to avoid duplication. */
.embed-mode #title,
.embed-mode #subtitle,
.embed-mode .sk-title,
.embed-mode .sk-subtitle { display: none; }

/* The body's min-height:100vh would inflate the iframe height (a feedback loop
   with the auto-resize) and leave a huge empty gap — drop it when embedded. */
.embed-mode { min-height: 0; }
/* Inline the fixed CTA (it would otherwise float over the form inside the
   iframe) and trim the bottom padding that only the standalone page needs. */
.embed-mode .sticky-bar { position: static; }
.embed-mode .page { padding-bottom: 24px; }

/* ── Phone verification (OTP) ──────────────────────────── */
.phone-wrap { display: flex; flex-direction: column; gap: 10px; }
.otp-container { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.otp-btn {
  padding: 9px 16px;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.otp-btn:hover:not(:disabled) { background: rgba(29, 161, 242, 0.08); }
.otp-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.otp-btn.primary { background: var(--primary); color: #fff; }
.otp-btn.primary:hover:not(:disabled) { background: #0f8fdc; }

.otp-input {
  width: 116px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 18px;
  letter-spacing: 5px;
  text-align: center;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.otp-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

.otp-resend {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 4px 2px;
}
.otp-resend:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

.otp-verified { color: var(--success); font-size: 14px; font-weight: 700; }
.otp-error { color: var(--error); font-size: 13px; margin: 0; width: 100%; }
.otp-hint { width: 100%; font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.otp-label { width: 100%; font-size: 13px; font-weight: 600; color: var(--text-soft); margin: 0 0 2px; }

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
@keyframes ripple {
  to { transform: scale(1); opacity: 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}
@keyframes drawPath {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  #form { padding: 24px 18px 22px; }
  .page { padding: 26px 14px 132px; }
  .entry { padding: 10px 13px; }
}

/* Respect users who prefer reduced motion — kill all animations/transitions. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
