/* =========================================================================
   Quotation wizard — matches the Lovable quick-quote card language.
   Design tokens come from the theme's design-system.css.
   ========================================================================= */

.d4t-wizard {
  max-width: 56rem;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lift);
}

/* --------------------------------------------------------- step rail -- */

.d4t-wizard__steps {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  scrollbar-width: none;
}
.d4t-wizard__steps::-webkit-scrollbar { display: none; }

.d4t-wizard__stepdot {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.d4t-wizard__stepdot .n {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.d4t-wizard__stepdot.is-active { color: var(--brand); font-weight: 600; }
.d4t-wizard__stepdot.is-active .n {
  background: var(--gradient-brand);
  border-color: transparent;
  color: var(--brand-foreground);
}
.d4t-wizard__stepdot.is-done { color: var(--navy); cursor: pointer; }
.d4t-wizard__stepdot.is-done .n { background: var(--navy); border-color: transparent; color: var(--navy-foreground); }

.d4t-wizard__bar { height: 3px; width: 100%; background: var(--border); }
.d4t-wizard__bar span {
  display: block;
  height: 100%;
  background: var(--gradient-brand);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------------------------------------- panels -- */

.d4t-wizard__panel { padding: 1.75rem 1.5rem; }
@media (min-width: 640px) { .d4t-wizard__panel { padding: 2.25rem 2.5rem; } }

/* Without JS every step stays visible and the form posts normally. */
.d4t-wizard.is-enhanced .d4t-wizard__panel { display: none; }
.d4t-wizard.is-enhanced .d4t-wizard__panel.is-active { display: block; animation: d4t-fade-in 0.35s ease both; }
.d4t-wizard:not(.is-enhanced) .d4t-wizard__panel + .d4t-wizard__panel { border-top: 1px solid var(--border); }

/* ---------------------------------------------------------- choices -- */

.d4t-choices { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .d4t-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .d4t-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.d4t-choice { display: block; cursor: pointer; }
.d4t-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.d4t-choice__box {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 3.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0.875rem 1rem;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.d4t-choice:hover .d4t-choice__box { border-color: var(--brand); transform: translateY(-2px); }
.d4t-choice input:checked + .d4t-choice__box {
  border-color: var(--brand);
  background: rgba(61, 122, 184, 0.06);
  box-shadow: 0 0 0 1px var(--brand);
}
.d4t-choice input:focus-visible + .d4t-choice__box { outline: 2px solid var(--ring); outline-offset: 2px; }
.d4t-choice__label { font-size: 0.9375rem; font-weight: 500; color: var(--navy); }
.d4t-choices.has-error .d4t-choice__box { border-color: var(--destructive); }

/* ----------------------------------------------------------- fields -- */

.d4t-field { display: flex; flex-direction: column; gap: 0.5rem; }
.d4t-field--full { grid-column: 1 / -1; }
.d4t-field > span { font-size: 0.875rem; font-weight: 500; color: var(--navy); }
.d4t-field em { color: var(--destructive); font-style: normal; }

.d4t-field input[type="text"],
.d4t-field input[type="email"],
.d4t-field input[type="tel"],
.d4t-field input[type="date"],
.d4t-field select,
.d4t-field textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--input);
  background: var(--background);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--foreground);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.d4t-field input:focus,
.d4t-field select:focus,
.d4t-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(61, 122, 184, 0.18);
}
.d4t-field.has-error input,
.d4t-field.has-error select,
.d4t-field.has-error textarea { border-color: var(--destructive); }
.d4t-field textarea { resize: vertical; min-height: 6rem; }

.d4t-consent { flex-direction: row; align-items: flex-start; gap: 0.75rem; }
.d4t-consent input { margin-top: 0.3rem; width: 1.05rem; height: 1.05rem; accent-color: var(--brand); flex-shrink: 0; }
.d4t-consent span { font-size: 0.875rem; font-weight: 400; color: var(--muted-foreground); }

/* Honeypot — hidden from people, still filled by bots.
   Clipped rather than pushed off-canvas: a `left: -9999px` element extends the
   scrollable area to the right under `direction: rtl`, which gave the Arabic
   pages ~10,000px of horizontal overflow. Clipping is direction-agnostic. */
.d4t-hp {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --------------------------------------------------------- dropzone -- */

.d4t-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.5rem;
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border);
  background: var(--surface);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s;
}
.d4t-drop.is-dragging { border-color: var(--brand); background: rgba(61, 122, 184, 0.05); }
.d4t-camera { display: none; }
@media (max-width: 639px) { .d4t-camera { display: inline-flex; } }

.d4t-files { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.d4t-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
}
.d4t-file__info { min-width: 0; }
.d4t-file__name {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.d4t-file__meta { display: block; font-size: 0.75rem; color: var(--success); }
.d4t-file__remove {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.d4t-file__remove:hover { color: var(--destructive); }

.d4t-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.d4t-privacy .d4t-ico { margin-top: 0.15rem; color: var(--success); }

/* ----------------------------------------------------------- review -- */

.d4t-review {
  margin: 0;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.d4t-review__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 640px) {
  .d4t-review__row { grid-template-columns: 12rem 1fr; gap: 1rem; align-items: baseline; }
}
.d4t-review__row:last-child { border-bottom: 0; }
.d4t-review dt { font-size: 0.8125rem; color: var(--muted-foreground); }
.d4t-review dd { margin: 0; font-size: 0.9375rem; font-weight: 500; color: var(--navy); overflow-wrap: anywhere; }

.d4t-wizard__error {
  margin-top: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--destructive);
  background: rgba(214, 69, 59, 0.06);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--destructive);
}

/* -------------------------------------------------------------- nav -- */

.d4t-wizard__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem 1.5rem;
}
@media (min-width: 640px) { .d4t-wizard__nav { padding: 1.25rem 2.5rem; } }
.d4t-wizard__nav [data-d4t-next],
.d4t-wizard__nav [data-d4t-submit] { margin-inline-start: auto; }
.d4t-wizard__nav .btn-whatsapp { order: 99; width: 100%; }
@media (min-width: 640px) { .d4t-wizard__nav .btn-whatsapp { order: 0; width: auto; margin-inline-end: auto; } }
.d4t-wizard__nav button[disabled] { opacity: 0.6; cursor: progress; transform: none; }

/* --------------------------------------------------------- thank you -- */

.d4t-thanks {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}
.d4t-thanks__ref {
  display: inline-block;
  margin-top: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 1.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--navy);
  direction: ltr;
}
