/* Webloom "Start a project" brief: a glass dialog whose rings link a little more with every step. */

.wizard {
  width: min(740px, calc(100vw - 24px));
  max-height: calc(100svh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.wizard::backdrop {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.wizard[open] { animation: wizard-in 0.6s var(--ease); }
@keyframes wizard-in { from { opacity: 0; transform: translateY(28px) scale(0.98); } }

.wizard__panel {
  display: grid;
  gap: 22px;
  max-height: calc(100svh - 24px);
  overflow: auto;
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--r-xl);
  /* nearly opaque: the page headline must not ghost through behind the form */
  background: linear-gradient(160deg, color-mix(in srgb, var(--card-solid) 92%, transparent), color-mix(in srgb, var(--card-solid) 84%, transparent));
}

.wizard__head { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.wizard__rings { width: 104px; }
.wizard__count { color: var(--muted); margin-bottom: 6px; }
.wizard__head h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); letter-spacing: -0.035em; }
.wizard__close svg { width: 18px; height: 18px; }

.wizard__progress { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.wizard__progress span { display: block; height: 100%; width: calc(var(--p, 0.25) * 100%); background: var(--blue); transition: width 0.6s var(--ease); }

.wizard__step { display: grid; gap: 18px; min-width: 0; margin: 0; padding: 0; border: 0; }
.wizard__step[hidden] { display: none; }
.wizard__step legend { padding: 0; margin-bottom: 16px; font: 600 1.3rem/1.2 var(--font-head); letter-spacing: -0.02em; }
.wizard__hint { color: var(--muted); font-size: 0.92rem; margin-top: -8px; }
.wizard__label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* big option cards (radio) */
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option { position: relative; }
.option input, .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.option__body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  height: 100%;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.option__body:hover { transform: translateY(-2px); }
.option__body svg { grid-row: span 2; width: 26px; height: 26px; color: var(--accent-text); }
.option__body b { font: 600 1.05rem var(--font-head); letter-spacing: -0.01em; }
.option__body small { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.option input:checked + .option__body { background: color-mix(in srgb, var(--blue) 10%, transparent); box-shadow: inset 0 0 0 2px var(--blue); }
.option input:focus-visible + .option__body, .choice input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* small choice chips (radio / checkbox) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow var(--dur), background-color var(--dur), color var(--dur);
}
.choice input:checked + span { background: var(--blue); color: var(--on-blue); box-shadow: none; }
.sub { display: grid; gap: 10px; }
.sub[hidden] { display: none; }

/* contact fields */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field span { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--line);
  outline: none;
  transition: box-shadow var(--dur);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.field [aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.turnstile[data-turnstile=""] { display: none; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.wizard__error { min-height: 1.3em; color: var(--danger); font-size: 0.9rem; }
.wizard__foot { display: flex; justify-content: space-between; gap: 12px; }
.wizard__foot[hidden] { display: none; }
.wizard__foot [hidden] { display: none; }
.wizard__foot [data-wizard-next], .wizard__foot [data-wizard-submit] { margin-left: auto; }

/* done */
.wizard__done { display: grid; justify-items: center; gap: 14px; padding: 8px 0 4px; text-align: center; }
.wizard__done[hidden] { display: none; }
.wizard__done h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); letter-spacing: -0.035em; }
.wizard__done p { color: var(--muted); max-width: 44ch; }
.wizard__done .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

@media (max-width: 640px) {
  .wizard { width: 100vw; max-width: 100vw; height: 100svh; max-height: 100svh; margin: 0; }
  .wizard__panel { height: 100%; max-height: none; border-radius: 0; align-content: start; }
  .wizard__head { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; }
  .wizard__rings { width: 72px; }
  .options, .fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .wizard[open] { animation: none; }
  .wizard__progress span, .option__body { transition: none; }
}
