:root {
  --primary: #024b2e;
  --primary-hover: #0a5c3a;
  --primary-light: #e8ede4;
  --primary-ring: rgba(2, 75, 46, 0.14);
  --secondary: #e0b852;
  --gold: #e0b852;
  --sand: #e1d2b7;
  --cream: #f7f4ed;

  --success: #024b2e;
  --success-light: #e8ede4;
  --success-fg: #01321e;
  --destructive: #992a2a;
  --destructive-light: #f6e4e0;
  --destructive-fg: #7a1f1f;

  --bg: #f7f4ed;
  --surface: #f8f6f2;
  --border: #dfd2b9;
  --border-focus: #cfc0a3;
  --text: #111827;
  --text-secondary: #2b3b2b;
  --text-muted: #6b7264;
  --disabled-bg: #efe8dc;
  --disabled-text: #8a8578;

  --brand-gradient: linear-gradient(160deg, #01321e 0%, #024b2e 55%, #0a5c3a 100%);
  --ai-gradient: linear-gradient(135deg, #e0b852, #024b2e);

  --font: "IBM Plex Sans Arabic", sans-serif;
  --radius-btn: 8px;
  --radius-input: 10px;
  --radius-lg: 16px;

  --shadow-2: 0 4px 12px rgba(1, 50, 30, 0.1);
  --shadow-cta: 0 4px 14px rgba(2, 75, 46, 0.28);

  --container: 800px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(2, 75, 46, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 30%, rgba(224, 184, 82, 0.1), transparent 50%),
    var(--bg);
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 2;
  padding: 20px 0 8px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  animation: brandPop 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-logo {
  display: block;
  height: clamp(56px, 12vw, 88px);
  width: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28));
}

.brand-tagline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--sand);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(225, 210, 183, 0.12);
  border: 1px solid rgba(224, 184, 82, 0.38);
  backdrop-filter: blur(8px);
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-gradient);
  color: var(--cream);
  padding: 0 0 64px;
  min-height: min(48vh, 380px);
  display: flex;
  flex-direction: column;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(225, 210, 183, 0.16), transparent 35%),
    radial-gradient(circle at 85% 70%, rgba(224, 184, 82, 0.18), transparent 42%);
}

.hero-atmosphere::before {
  content: "";
  position: absolute;
  inset-inline: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 184, 82, 0.55), transparent);
}

.hero-atmosphere::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  top: -80px;
  left: -60px;
  animation: drift 14s ease-in-out infinite alternate;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 0 8px;
  animation: fadeInUp 0.7s ease 0.08s both;
}

.hero h1 {
  font-size: clamp(1.65rem, 4.8vw, 2.15rem);
  font-weight: 700;
  line-height: 1.35;
  max-width: 18ch;
  margin: 0 auto 14px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero-sub {
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  line-height: 1.75;
  opacity: 0.92;
  max-width: 38ch;
  margin: 0 auto 22px;
}

.hero-cta-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(225, 210, 183, 0.12);
  border: 1px solid rgba(224, 184, 82, 0.35);
  color: var(--sand);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(224, 184, 82, 0.55);
  animation: pulse 1.8s ease-out infinite;
}

.form-section {
  padding: 32px 0 64px;
  margin-top: -28px;
}

.form-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 28px 20px;
  animation: fadeInUp 0.75s ease 0.1s both;
}

@media (min-width: 640px) {
  .form-panel {
    padding: 36px 32px;
  }
}

.form-intro {
  margin-bottom: 8px;
  border-right: 3px solid var(--primary);
  padding-right: 14px;
}

.form-intro h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
}

.form-intro p {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-block {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.form-block h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.fields-grid {
  display: grid;
  gap: 0 16px;
}

@media (min-width: 640px) {
  .fields-grid {
    grid-template-columns: 1fr 1fr;
  }

  .span-2 {
    grid-column: 1 / -1;
  }
}

.field {
  margin-bottom: 18px;
}

.field label,
.label-text {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.required {
  color: var(--primary);
}

.optional {
  color: var(--text-secondary);
  font-weight: 400;
}

.hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field select {
  cursor: pointer;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #b8a57c;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.field.has-error .file-box {
  border-color: var(--destructive);
}

.field-error {
  font-size: 12px;
  color: var(--destructive);
  margin-top: 4px;
  min-height: 1.2em;
}

.choice-row {
  display: flex;
  gap: 8px;
}

.choice {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-input);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.choice input:checked + span {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.choice input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.file-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px dashed var(--border-focus);
  border-radius: var(--radius-input);
  cursor: pointer;
  background: var(--surface);
}

.file-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-action {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.file-name {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repeater-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.repeater-row input {
  flex: 1;
}

.btn-icon {
  width: 48px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: var(--radius-input);
  cursor: pointer;
  color: var(--destructive);
  font-size: 22px;
  line-height: 1;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
}

.btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 52px;
}

.btn-submit:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-cta);
}

.btn-submit:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-submit.is-loading .btn-text {
  display: none;
}

.btn-submit.is-loading .btn-loading {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.form-status {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  min-height: 1.2em;
}

.form-status.is-error {
  color: var(--destructive-fg);
  background: var(--destructive-light);
  border-right: 4px solid var(--destructive);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: right;
}

.privacy-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}

.success-state {
  text-align: center;
  padding: 28px 12px 12px;
  animation: fadeInUp 0.45s ease;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 0 8px rgba(2, 75, 46, 0.08);
}

.success-state h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--success-fg);
  margin-bottom: 8px;
}

.success-state p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 34ch;
  margin: 0 auto;
  line-height: 1.7;
}

.perks {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.perks h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--ai-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.perks-lead {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.perks ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.55;
}

.perk-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--success-light);
  position: relative;
}

.perk-mark::after {
  content: "";
  position: absolute;
  inset: 6px 5px 7px 6px;
  border: solid var(--success);
  border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg);
}

.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

input[dir="ltr"],
select[dir="ltr"] {
  text-align: left;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes brandPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(224, 184, 82, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(224, 184, 82, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(224, 184, 82, 0);
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(24px, 18px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
