/*
  Page structure for the embedded customer-facing form. Trimmed from the
  standalone staff app's layout.css: no app-bar (this lives inside a
  WordPress page that already has its own site header/nav), and the
  action area is a normal in-flow block rather than sticky, since a
  fixed bar inside someone else's page layout can behave unpredictably
  depending on their theme. Card *contents* (inputs, buttons, signature
  pad) are styled in components.css, shared unchanged with the
  standalone app.
*/

.bwha-embed {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.app-main {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  --line-offset: 66px;
}

/* A quiet dotted line linking the numbered stage badges, visible only in
   the gaps between cards — the same "trail" idea used in the standalone
   app, expressed as wayfinding rather than decoration. */
.app-main::before {
  content: "";
  position: absolute;
  top: var(--space-7);
  bottom: var(--space-7);
  left: var(--line-offset);
  width: 2px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--color-moss-400) 0,
    var(--color-moss-400) 6px,
    transparent 6px,
    transparent 14px
  );
  z-index: 0;
}

@media (max-width: 599px) {
  .app-main::before {
    display: none;
  }
}

.stage-card {
  position: relative;
  z-index: 1;
  background: var(--color-stone-50);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  overflow: hidden;
}

.stage-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stage-card__badge {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-forest-800);
  color: var(--color-stone-50);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-card__titles h2 {
  margin-bottom: var(--space-1);
}

.stage-card__titles p {
  margin: 0;
  color: var(--color-slate-700);
  font-size: var(--text-sm);
}

/* A quiet echo of the brand's contour motif, used once on an accent
   card so the "trail" idea threads through without repeating on every
   card. */
.stage-card--accent::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--contour-motif);
  background-repeat: no-repeat;
  background-position: right -60px bottom -80px;
  background-size: 380px;
  opacity: 0.5;
  pointer-events: none;
}

/* ---------------------------------------------------------------- */
/* Action area (not sticky — see file header note)                    */
/* ---------------------------------------------------------------- */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) 0 0;
  margin-top: var(--space-2);
  border-top: 1px solid var(--color-stone-200);
}

.action-bar__meta {
  margin-right: auto;
  font-size: var(--text-xs);
  color: var(--color-slate-700);
  flex-basis: 100%;
}

/* ---------------------------------------------------------------- */
/* Responsiveness                                                    */
/* ---------------------------------------------------------------- */

@media (max-width: 480px) {
  .app-main {
    gap: var(--space-4);
    --line-offset: 46px;
  }

  .stage-card {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }

  .action-bar {
    gap: var(--space-2);
  }
}

@media (max-width: 420px) {
  .action-bar .btn {
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
  }
}

@media (min-width: 768px) {
  .app-main {
    gap: var(--space-6);
    --line-offset: 74px;
  }

  .stage-card {
    padding: var(--space-7);
  }
}
