/* ==========================================================
   CLICKFU — Mini App Launcher (Phase 2) styles
   Loads AFTER clickfu.css and the active palette.
   ========================================================== */

/* ---------- Intro ---------- */
.launcher-intro {
  padding: 60px 0 30px;
  text-align: center;
}
.launcher-intro h1 {
  font-family: var(--font-head);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 14px 0 18px;
}
.launcher-intro .lede {
  max-width: 720px;
  margin: 0 auto;
  font-size: 18px;
  color: var(--text-mute);
  line-height: 1.6;
}

/* ---------- Form section ---------- */
.launcher-form-section {
  padding: 30px 0 80px;
}

/* ---------- Step progress ---------- */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 36px;
  max-width: 620px;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.step-dot span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-mute);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s ease;
}
.step-dot label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.step-dot.active span {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}
.step-dot.complete span {
  background: var(--bg-card);
  color: var(--primary);
  border-color: var(--primary);
}
.step-dot.complete span::before {
  content: "✓";
}
.step-dot.complete span > * { display: none; }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  max-width: 110px;
}

/* ---------- Form ---------- */
.launcher-form {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
}
.launcher-form legend {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 22px;
}

.step {
  display: none;
  border: none;
  padding: 0;
  margin: 0;
}
.step.active {
  display: block;
  animation: stepFade 0.24s ease;
}
@keyframes stepFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.field {
  margin-bottom: 22px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text);
}
.field label.optional-label span {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 13px;
  margin-left: 4px;
}
.field input[type=text],
.field input[type=email],
.field textarea,
.field select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea {
  resize: vertical;
  min-height: 80px;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.field-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

/* ---------- Radio cards ---------- */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.radio-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
  user-select: none;
}
.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.radio-card:hover { border-color: var(--primary); }
.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft, color-mix(in srgb, var(--primary) 8%, transparent));
  color: var(--primary);
}

/* ---------- Step nav buttons ---------- */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}
.step-nav .btn-primary { margin-left: auto; }

.btn-ghost {
  background: transparent;
  color: var(--text-mute);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-mute); }

.btn-lg {
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 700;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-disclaimer {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin: 18px 0 0;
}
.form-error {
  text-align: center;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Building overlay ---------- */
.building-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 20px;
}
.building-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.building-spinner {
  width: 56px; height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 22px;
  animation: spin 1s linear infinite;
}
.building-box h3 {
  font-family: var(--font-head);
  font-size: 22px;
  margin: 0 0 6px;
}
.building-box p {
  color: var(--text-mute);
  margin: 0 0 22px;
  font-size: 15px;
  min-height: 22px;
}
.building-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.building-steps li {
  padding-left: 28px;
  position: relative;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.3s ease;
}
.building-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
}
.building-steps li.active {
  color: var(--text);
  font-weight: 600;
}
.building-steps li.active::before {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.building-steps li.done {
  color: var(--text-mute);
}
.building-steps li.done::before {
  content: "✓";
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.footer-bar-only {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-dim);
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .launcher-form { padding: 26px 20px; }
  .step-progress { gap: 8px; }
  .step-line { max-width: 50px; }
  .step-dot label { display: none; }
  .step-nav { flex-direction: column-reverse; align-items: stretch; }
  .step-nav .btn { width: 100%; }
  .step-nav .btn-primary { margin-left: 0; }
}
