/* =========================
   File: step-buttons.css
   ========================= */

/* ---------- Step base ---------- */
.ll-step {
  display: none;              /* hidden by default */
  opacity: 0;
  transition: opacity .3s ease;
}
.ll-step.ll-step-active {
  display: grid;              /* columns set below */
  grid-template-columns: 1fr;
  gap: var(--ll-gap, 16px);
  opacity: 1;
  animation: llFadeIn .3s ease;
}
@keyframes llFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Progress + labels ---------- */
.ll-progress-bar {
  width: 100%;
  height: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  background: #eee;
  border-radius: 5px;
}
.ll-progress-indicator {
  height: 100%;
  width: 0;
  background: var(--ll-accent, #0b5c7a);
  transition: width .3s ease;
}

.ll-step-labels {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
}
.ll-step-labels li {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #999;
  position: relative;
}
.ll-step-labels li.active,
.ll-step-labels li.completed { color: var(--ll-accent, #0b5c7a); }
.ll-step-labels li.completed { opacity: .6; }
.ll-step-labels li::after {
  content: "";
  display: block;
  margin: 4px auto 0;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
}

.ll-final-step { font-size: 1.1rem; text-align: center; padding: 2rem; }

/* ---------- Headings inside steps ---------- */
.ll-step .ll-question-heading:first-of-type {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 1.2rem;
  text-align: center;
}

/* ---------- Per-step tweaks ---------- */
.ll-step .ll-premium-options { margin-top: 6px; }
.ll-step .ll-step-buttons { margin-top: 10px; }

.ll-premium-step-note,
.ll-step-premium-note {
  margin-top: 12px;
  font-size: 13px;
  opacity: .85;
  color: var(--ll-muted, #64748b);
  border-top: 1px dashed #e5e7eb;
  padding-top: 8px;
}

/* ---------- Responsive grid layout ---------- */
/* ≥720px: steps data-step="1" and "2" use two columns */
@media (min-width: 720px) {
  .ll-step.ll-step-active[data-step="1"],
  .ll-step.ll-step-active[data-step="2"] {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  /* Full-width elements inside any active grid step */
  .ll-step.ll-step-active > .ll-premium-step-note,
  .ll-step.ll-step-active > .ll-step-premium-note,
  .ll-step.ll-step-active > .ll-step-buttons,
  .ll-step.ll-step-active > h3 {
    grid-column: 1 / -1;
  }
}

/* Optional: tighter spacing for fields on steps 1–2 */
.ll-step.ll-step-active[data-step="1"] > .ll-field,
.ll-step.ll-step-active[data-step="2"] > .ll-field { margin: 0; }

/* Address/Phone/Website layout helpers when a step is 2-col */
@media (min-width: 720px) {
  .ll-step.ll-step-active > .ll-field:has(#ll_address) { grid-column: 1 / -1; }
  .ll-step.ll-step-active > .ll-field:has(#ll_phone),
  .ll-step.ll-step-active > .ll-field:has(#ll_website) { grid-column: auto; }
}

/* ---------- Step navigation buttons ---------- */
.ll-step-buttons {
  display: flex;
  justify-content: space-between;   /* default when both buttons show */
  align-items: center;
  gap: 10px;
  /* margin-top is already set above on .ll-step .ll-step-buttons */
}

/* Natural sizes */
.ll-step-buttons button { flex: 0 0 auto; }

/* Always allow Next to float right */
.ll-step-buttons .next-step { margin-left: auto; }
.ll-step-buttons .prev-step { margin-right: auto; }

/* Right-justify when Back is absent or hidden (no :has needed) */
.ll-step-buttons > .prev-step[hidden] + .next-step,
.ll-step-buttons > .prev-step[style*="display:none"] + .next-step,
.ll-step-buttons > .prev-step.hidden + .next-step,
.ll-step-buttons > .prev-step.is-hidden + .next-step,
.ll-step-buttons > .prev-step[aria-hidden="true"] + .next-step {
  margin-left: auto !important;
}

/* If you want the :has() version too (modern engines), keep it lean */
.ll-step-buttons:not(:has(.prev-step)),
.ll-step-buttons:has(.prev-step[hidden]),
.ll-step-buttons:has(.prev-step[style*="display:none"]),
.ll-step-buttons:has(.prev-step.hidden),
.ll-step-buttons:has(.prev-step.is-hidden),
.ll-step-buttons:has(.prev-step[aria-hidden="true"]) {
  justify-content: flex-end !important;
}

/* When we intentionally omit Back, force Next to the right */
.ll-step-buttons.ll-no-prev { justify-content: flex-end !important; }
