:root {
  --bg-hero: #e9d8ff;
  --bg-page: #ffffff;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #7c5cff;
  --accent-700: #6748ff;
  --accent-900: #4a2eff;
  --danger: #ff6b6b;
  --ring: 0 0 0 2px color-mix(in lab, var(--accent) 35%, transparent);
  --radius: 14px;
  --hero-height: 360px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg-page);
}
[hidden] { display: none !important; }
/* Global link styling */
a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent); }
/* Prevent background scroll when modal open */
body.modal-open { overflow: hidden; }

.hero {
  /* Fill the entire hero area with color to avoid white gaps */
  background: linear-gradient(180deg, var(--bg-hero) 0%, var(--bg-hero) 100%);
  padding-bottom: 40px;
  position: relative; /* allow pseudo-element shadow positioning */
  /* Visible bottom shadow under the hero */
  box-shadow: 0 34px 70px -36px rgba(17,24,39,.18);
  margin-bottom: 60px; /* increased for logo overlap space */
  overflow: visible;
}
.brand { 
  position: absolute;
  left: 23%;
  bottom: -50px;
  z-index: 10;
}
.logo {
  width: 100px;
  height: 100px;
  border-radius: 999px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(124,92,255,.35), 0 8px 18px rgba(0,0,0,.25);
}

/* Soft shadow under the hero */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: clamp(360px, 88vw, 1000px);
  height: 26px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(17,24,39,.16), rgba(17,24,39,0) 70%);
  filter: blur(10px);
  z-index: 0;
}

/* Subtle accent glow layered beneath */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: clamp(320px, 80vw, 860px);
  height: 18px;
  pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in lab, var(--accent) 28%, transparent), transparent 62%);
  filter: blur(12px);
  opacity: .5;
  z-index: 0;
}

.hero-content { max-width: 1000px; margin: 0 auto; padding: 40px 28px 28px; text-align: center; }
.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  margin: 18px 0 0;
  letter-spacing: -0.02em;
  color: #111827;
  text-shadow:
    0 1px 0 rgba(255,255,255,.6),
    0 3px 10px rgba(17,24,39,.14),
    0 14px 34px rgba(124,92,255,.20);
}
.notice {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-top: 18px;
}
.notice h2 { font-size: 16px; color: var(--muted); margin: 0 0 10px; }
.notice p { color: var(--text); margin: 8px 0; }
.notice a.primary {
  display: inline-block;
  margin-top: 10px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  transition: .2s ease background, .2s ease transform;
}
.notice a.primary:hover { background: var(--accent-700); transform: translateY(-1px); }

.container { max-width: 900px; margin: 0 auto; padding: 0 28px 80px; }
.back { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; line-height: 1.2; }
.back .icon { color: var(--text); margin: 0; }
.icon svg { width: 1em; height: 1em; display: block; }
.container h2 { font-size: 28px; margin: 6px 0 12px; }

/* Steps nav */
.steps { display: flex; gap: 8px; margin: 0 0 12px; }
.step {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.15;
  font-synthesis: none;
  font-family: inherit;
  font-size: 15px;
}
.step.current { color: var(--text); border-color: var(--accent); font-weight: 600; }

form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.step-page { display: block; }
/* Ensure hidden step pages are not displayed */
.step-page[hidden] { display: none; }

/* Modal */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.modal-dialog {
  position: relative;
  max-width: 760px;
  width: calc(100% - 32px);
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 22px 16px;
  box-shadow: 0 30px 70px rgba(0,0,0,.15), 0 0 0 1px #e5e7eb;
  transform: translateY(10px);
  transition: transform .25s ease;
}
.modal.open .modal-dialog { transform: translateY(0); }
.modal-dialog h2 { font-size: 20px; color: var(--muted); margin: 0 0 10px; }
.modal-dialog p { margin: 10px 0; }
.review { padding: 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; }
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.review-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.review-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fbfbff, #f6f7ff);
  border-bottom: 1px solid #eef0f5;
}
.review-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in lab, var(--accent) 14%, white);
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}
.review-card-title {
  font-weight: 700;
  color: var(--text);
}
.review-list { padding: 12px 16px 8px; display: grid; gap: 12px; }
.review-item { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 12px; align-items: start; }
.review-label { color: var(--muted); font-weight: 600; }
.review-value { color: var(--text); word-break: break-word; }
.review-empty { color: #9ca3af; font-style: italic; }
.card-actions { display: flex; justify-content: flex-end; padding: 10px 12px 12px; gap: 8px; }

button.secondary {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: .18s ease background, .18s ease transform, .18s ease border-color;
}
button.secondary:hover { background: #f8fafc; border-color: #dbe1ea; transform: translateY(-1px); }
button.secondary:active { transform: translateY(0); }
.success { margin-top: 12px; padding: 12px; background: #ecfdf5; border: 1px solid #d1fae5; border-radius: 12px; color: #065f46; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.label-row { display: flex; align-items: baseline; gap: 8px; }
label { font-weight: 600; color: var(--text); }
.sub-label { font-weight: 600; color: var(--text); }
.hint { color: var(--muted); font-weight: 500; font-size: 0.9em; }
.divider { grid-column: 1 / -1; color: var(--muted); font-weight: 700; margin: 10px 2px 0; }

input, select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: var(--text);
  padding: 12px 12px;
  border-radius: 12px;
  outline: none;
  transition: .15s ease border-color, .15s ease box-shadow, .15s ease transform;
}
input::placeholder { color: #9ca3af; }
input:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); }
input[aria-invalid="true"] { border-color: var(--danger); }

.actions { display: flex; justify-content: flex-end; margin-top: 8px; }
button.primary {
  appearance: none;
  border: none;
  background: var(--accent);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.15;
  font-synthesis: none;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: .2s ease background, .2s ease transform, .2s ease box-shadow;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.primary .icon { display: inline-flex; }
button.primary:hover { background: var(--accent-700); }
button.primary:active { background: var(--accent-900);}

.footer { max-width: 900px; margin: 0 auto; padding: 18px 28px 40px; color: var(--muted); }

/* Payment Section */
.payment-info {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.payment-description {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text);
}

.payment-note {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.payment-form {
  margin-bottom: 24px;
}

#payment-element {
  margin-bottom: 16px;
}

.payment-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.payment-message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.payment-message.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.payment-message.info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Uploaders */
.uploader {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.dropzone {
  background: var(--card);
  border: 2px dashed #d1d5db;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.dropzone:hover { border-color: var(--accent); box-shadow: 0 16px 40px rgba(0,0,0,.12); }
.dropzone.is-dragover { border-color: var(--accent); background: #f8fafc; }
.dz-content { display: grid; gap: 8px; justify-items: center; }
.dz-icon { color: var(--accent); }
.dz-title { font-weight: 700; color: var(--text); }
.dz-sub { color: var(--muted); font-weight: 500; }
.dz-note { color: #6b7280; font-size: 13px; }
.dz-preview { margin-top: 8px; display: grid; gap: 8px; }
.dz-thumb { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; border: 1px solid #e5e7eb; box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.dz-filename { font-size: 13px; color: var(--muted); }

/* Required badge */
.required-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #fee;
  color: #c00;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
}

/* Validation status */
.dz-validation {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: none;
}

.dz-validation.validating {
  display: block;
  background: #fff4e5;
  color: #d97706;
  border: 1px solid #fbbf24;
}

.dz-validation.valid {
  display: block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.dz-validation.error,
.dz-validation.invalid {
  display: block;
  background: #fee;
  color: #c00;
  border: 1px solid #f87171;
}

/* Responsive */
@media (max-width: 820px) {
  .form-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .uploader { grid-template-columns: 1fr; }
}

/* Mobile spacing tweaks */
@media (max-width: 480px) {
  :root {
    --radius: 12px;
    --hero-height: 240px;
  }

  .hero { 
    padding-bottom: 24px;
    margin-bottom: 24px;
  }
  
  /* Revert logo to centered position on mobile */
  .brand {
    position: static;
    display: flex;
    justify-content: center;
    padding-top: 20px;
  }
  
  .hero-content { padding: 16px 16px 0; }
  .hero h1 {
    font-size: clamp(28px, 6.5vw, 48px);
    margin: 10px 0 0;
    text-shadow:
      0 1px 0 rgba(255,255,255,.5),
      0 2px 8px rgba(17,24,39,.12),
      0 10px 24px rgba(124,92,255,.16);
  }

  /* Tighter, lighter shadow on mobile */
  .hero::after {
    width: clamp(260px, 92vw, 640px);
    height: 20px;
    bottom: 0;
    filter: blur(8px);
    background: radial-gradient(closest-side, rgba(17,24,39,.14), rgba(17,24,39,0) 70%);
  }
  .hero::before {
    width: clamp(240px, 88vw, 560px);
    height: 14px;
    bottom: 0;
    filter: blur(10px);
    opacity: .45;
  }

  .container { padding: 16px 16px 64px; }

  .steps {
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    justify-content: center;
  }
  .step { padding: 6px 10px; font-size: 14px; }

  .form-grid { gap: 14px; }
  .field { gap: 6px; }
  .label-row { gap: 6px; }

  input, select { padding: 10px 12px; }

  .actions { justify-content: center; }
  .footer { padding: 16px 16px 32px; }
  .review-grid { grid-template-columns: 1fr; gap: 16px; }
  .review-item { grid-template-columns: 1fr; }
}

/* Datepicker */
.datepicker-popover {
  position: absolute;
  z-index: 1200;
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
  padding: 10px;
  width: 280px;
}
/* Combobox popover uses the same base with different padding/width */
.combo-popover {
  position: absolute;
  z-index: 1200;
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
  padding: 6px;
  max-height: 260px;
  overflow: auto;
}
.combo-item {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}
.combo-item:hover, .combo-item.active { background: #f3f4f6; }
.datepicker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px;
}
.datepicker-nav {
  display: flex;
  gap: 6px;
}
.datepicker-btn {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 6px;
}
.datepicker-grid.months { grid-template-columns: repeat(3, 1fr); }
.datepicker-grid.years { grid-template-columns: repeat(4, 1fr); }
.datepicker-cell {
  text-align: center;
  padding: 8px 0;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}
.datepicker-cell.muted { color: var(--muted); }
.datepicker-cell.today { border-color: var(--accent); }
.datepicker-cell:hover { background: #f3f4f6; border-color: var(--accent); }
.datepicker-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0 6px;
  color: var(--muted);
  font-weight: 600;
  justify-items: center;
  align-items: center;
}
.hebrew-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 6px;
}
.hebrew-select, .hebrew-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
}
.datepicker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px;
}
