:root {
  --font-arabic: "IBM Plex Sans Arabic", "Tahoma", "Segoe UI", sans-serif;
  --font-latin: "Manrope", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --ink: #17211d;
  --muted: #6b7770;
  --paper: #fbf7ef;
  --surface: rgba(255, 252, 246, 0.92);
  --surface-strong: #fffdf8;
  --line: rgba(23, 33, 29, 0.12);
  --brand: #174b3f;
  --brand-deep: #0d322a;
  --accent: #c88f4d;
  --accent-soft: #f0dfc8;
  --danger: #a23b2a;
  --success: #1d6b4f;
  --shadow: 0 24px 70px rgba(24, 37, 31, 0.16);
  --shadow-soft: 0 12px 34px rgba(24, 37, 31, 0.1);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-arabic);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 12% 12%, rgba(200, 143, 77, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(23, 75, 63, 0.16), transparent 30rem),
    linear-gradient(145deg, #fffaf1 0%, #f4efe5 45%, #edf3ef 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(23, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 29, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  position: relative;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.primary-cta,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.hero {
  display: grid;
  gap: 26px;
  align-items: center;
  padding: 24px 0 46px;
}

.hero-copy,
.hero-card,
.lead-form-card,
.form-intro {
  animation: riseIn 680ms ease both;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 16px;
  color: var(--brand-deep);
  font-size: clamp(2rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.subheadline {
  max-width: 680px;
  margin-bottom: 14px;
  color: #34423b;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  line-height: 1.9;
}

.trust-message {
  max-width: 620px;
  margin-bottom: 26px;
  color: var(--muted);
  line-height: 1.8;
}

.primary-cta,
.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 16px 34px rgba(23, 75, 63, 0.28);
}

.primary-cta {
  padding: 15px 28px;
  font-weight: 800;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.92), rgba(255, 255, 255, 0.76)),
    linear-gradient(145deg, rgba(23, 75, 63, 0.1), transparent);
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset-inline-start: -40px;
  bottom: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(200, 143, 77, 0.24);
}

.hero-card p {
  color: var(--muted);
  font-weight: 700;
}

.hero-card strong {
  display: block;
  max-width: 360px;
  color: var(--brand-deep);
  font-size: 1.35rem;
  line-height: 1.75;
}

.hero-card-line {
  width: 56px;
  height: 5px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: var(--accent);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 150px;
  margin-top: 28px;
}

.mini-grid span {
  height: 42px;
  border-radius: 16px;
  background: rgba(23, 75, 63, 0.1);
}

.form-section {
  display: grid;
  gap: 18px;
  align-items: start;
  padding-top: 12px;
}

.form-intro {
  padding: 4px 6px;
}

.form-intro h2 {
  margin-bottom: 10px;
  color: var(--brand-deep);
  font-size: clamp(1.55rem, 4vw, 2.5rem);
}

.form-intro p:last-child {
  color: var(--muted);
  line-height: 1.85;
}

.lead-form-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.progress-wrap {
  padding: 22px 22px 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 33, 29, 0.08);
}

.progress-bar {
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  transition: width 260ms ease;
}

.step-content {
  padding: 24px 22px 8px;
  animation: fadeSlide 260ms ease both;
}

.step-heading {
  margin-bottom: 22px;
}

.step-heading h2 {
  margin-bottom: 8px;
  color: var(--brand-deep);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.step-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.85;
  white-space: pre-line;
}

.notice {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(200, 143, 77, 0.35);
  border-radius: var(--radius-md);
  color: #5c432a;
  background: rgba(240, 223, 200, 0.58);
  line-height: 1.85;
}

.question {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.question-label,
legend.question-label {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.65;
}

.latin-label {
  font-family: var(--font-latin);
  letter-spacing: -0.01em;
  text-align: start;
}

.required-mark {
  color: var(--accent);
}

.field-input,
.field-textarea {
  width: 100%;
  border: 1px solid rgba(23, 33, 29, 0.14);
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border 180ms ease, box-shadow 180ms ease;
}

.field-input {
  min-height: 52px;
  padding: 0 16px;
}

.field-textarea {
  min-height: 150px;
  resize: vertical;
  padding: 15px 16px;
  line-height: 1.8;
}

.field-input:focus,
.field-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 75, 63, 0.12);
}

.options-grid {
  display: grid;
  gap: 10px;
}

.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 52px;
  padding: 14px 15px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 16px;
  background: #fff;
  color: #2f3935;
  line-height: 1.65;
  transition: border 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.option-card:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 75, 63, 0.36);
  box-shadow: 0 10px 20px rgba(23, 75, 63, 0.08);
}

.option-card:has(input:checked) {
  border-color: rgba(23, 75, 63, 0.72);
  background: linear-gradient(135deg, rgba(23, 75, 63, 0.08), rgba(200, 143, 77, 0.1));
  box-shadow: 0 12px 22px rgba(23, 75, 63, 0.1);
}

.option-card input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
  accent-color: var(--brand);
}

.form-error {
  margin: 0 22px 18px;
  padding: 14px 16px;
  border: 1px solid rgba(162, 59, 42, 0.25);
  border-radius: 16px;
  color: var(--danger);
  background: rgba(162, 59, 42, 0.08);
  line-height: 1.7;
}

.form-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  padding: 18px 22px 24px;
  border-top: 1px solid rgba(23, 33, 29, 0.08);
  background: rgba(255, 255, 255, 0.38);
}

.primary-button,
.secondary-button {
  min-height: 54px;
  padding: 0 22px;
  font-weight: 800;
}

.secondary-button {
  color: var(--brand);
  background: rgba(23, 75, 63, 0.08);
}

.secondary-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary-cta:hover,
.primary-button:hover,
.secondary-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.success-panel {
  padding: 34px 24px;
  text-align: center;
  animation: riseIn 420ms ease both;
}

.success-panel h2 {
  color: var(--success);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.success-panel p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 2;
}

@media (min-width: 680px) {
  .page-shell {
    width: min(1160px, calc(100% - 56px));
    padding-top: 24px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    padding: 54px 0 78px;
  }

  .form-section {
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
    gap: 34px;
  }

  .form-intro {
    position: sticky;
    top: 24px;
    padding-top: 16px;
  }

  .progress-wrap,
  .step-content,
  .form-actions {
    padding-inline: 30px;
  }

  .form-error {
    margin-inline: 30px;
  }

  .form-actions {
    flex-direction: row;
    justify-content: space-between;
  }

  .primary-button,
  .secondary-button {
    min-width: 150px;
  }

  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question.full-width .options-grid,
  .question.text-question .options-grid {
    grid-template-columns: 1fr;
  }
}

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

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
