/* TipMate — como-funciona.html page layout (stage, stepper, caption, explainer).
 * The device frames and app screens themselves live in screens.css. */


.dm-section { position: relative; padding: 2.5rem 2rem 5rem; }

/* ─── Stepper (device labels on desktop, tabs on mobile) ─── */
.dm-steps { display: flex; justify-content: center; gap: 0.5rem; margin: 0 auto 1.25rem; flex-wrap: wrap; }
.dm-step {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 500;
  color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 50px;
  padding: 0.45rem 1rem 0.45rem 0.5rem; cursor: pointer;
  transition: color .3s, background .3s, border-color .3s;
}
.dm-step-num {
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace; font-size: 0.75rem; font-weight: 700;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); transition: all .3s;
}
.dm-step.is-active { color: #fff; border-color: var(--accent-border); background: var(--accent-dim); }
.dm-step.is-active .dm-step-num { background: var(--accent); color: var(--bg); }
.dm-step.is-done .dm-step-num { background: rgba(73,205,254,0.25); color: var(--accent); }
.dm-step:disabled { cursor: default; }

/* ─── Stage ──────────────────────────────────────────────── */
.dm-stage {
  position: relative; max-width: 1320px; margin: 0 auto;
  /* Phones shrink on short screens so all three devices fit under the caption */
  --dm-phone-w: clamp(222px, calc((100vh - 411px) * 0.469), 270px);
  display: grid; grid-template-columns: var(--dm-phone-w) var(--dm-phone-w) minmax(0, 1fr);
  gap: 3.5rem; align-items: stretch;
}
.dm-device { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.dm-device-frame { margin: auto 0; }
.dm-device-frame.is-laptop { width: 100%; display: flex; justify-content: center; }
.dm-device-label {
  font-family: 'Space Mono', monospace; font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-bottom: 1rem; transition: color .3s; white-space: nowrap;
}
.dm-device.is-active .dm-device-label { color: var(--accent); }
.dm-device-frame { transition: box-shadow .5s, transform .5s, opacity .5s, filter .5s; }
.dm-device.is-dim .dm-device-frame { opacity: 0.72; }
.dm-device.is-active .dm-phone, .dm-device.is-active .dm-laptop-lid { box-shadow: 0 30px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(73,205,254,0.35), 0 0 60px rgba(73,205,254,0.18); }


.dm-flight { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 20; }
.dm-flight-path { fill: none; stroke: rgba(73,205,254,0.35); stroke-width: 2; stroke-dasharray: 2 8; stroke-linecap: round; opacity: 0; transition: opacity .4s; }
.dm-flight-path.is-on { opacity: 1; }

/* Caption under the stage */
.dm-caption { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.dm-caption-body { min-height: 5.6rem; }
/* Grows when the final message and its two buttons wrap on phones — never overlaps the text */
.dm-caption-slot { padding: 0.35rem 0; display: flex; align-items: center; justify-content: center; }
.dm-caption-slot:has(> [hidden]:only-child) { padding: 0; }
.dm-caption-kicker { font-family: 'Space Mono', monospace; font-size: 0.8rem; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 0.5rem; }
.dm-caption h2 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); font-weight: 700; letter-spacing: -0.5px; margin-bottom: 0.5rem; }
.dm-caption p { color: var(--muted); font-size: 1rem; max-width: 640px; margin: 0 auto; }
.dm-caption-body { transition: opacity .3s, transform .3s; }
.dm-caption-body.is-swapping { opacity: 0; transform: translateY(8px); }
.dm-caption-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.dm-caption-actions .btn-primary, .dm-caption-actions .btn-secondary { padding: 0.7rem 1.5rem; font-size: 0.95rem; }
.dm-caption-actions[hidden] { display: none; }





/* ─── Responsive: one device at a time below 1100px ──────── */
@media (max-width: 1099px) {
  .dm-section { padding: 1.75rem 1rem 3.5rem; }
  .dm-steps { flex-wrap: nowrap; gap: 0.4rem; }
  .dm-step { padding: 0.35rem; font-size: 0.85rem; }
  .dm-step.is-active { padding-right: 0.85rem; }
  .dm-step:not(.is-active) .dm-step-label { display: none; }
  .dm-stage { display: block; max-width: 560px; height: var(--dm-mobile-h, 600px); overflow: hidden; }
  .dm-device {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; justify-content: flex-start;
    transition: transform .55s cubic-bezier(0.4, 0, 0.2, 1), opacity .45s;
  }
  .dm-device.is-left { transform: translateX(-110%); opacity: 0; pointer-events: none; }
  .dm-device.is-right { transform: translateX(110%); opacity: 0; pointer-events: none; }
  .dm-device.is-dim .dm-device-frame { opacity: 1; filter: none; }
  .dm-device-label { display: none; }
  .dm-device-frame { margin: 0; }
  .dm-laptop { max-width: 100%; }
  .dm-caption { margin-bottom: 1rem; }
  .dm-caption-body { min-height: 7.2rem; }
}
@media (max-width: 1099px) { .dm-stage { --dm-phone-w: 270px; } }
@media (max-width: 1099px) and (min-width: 700px) { .dm-stage { --dm-phone-w: 290px; } }
@media (max-width: 400px) { .dm-stage { --dm-phone-w: 252px; } }

@media (prefers-reduced-motion: reduce) {
  .dm-device, .dm-tip.is-new, .dm-status.is-on .dm-status-ring { animation: none !important; transition: opacity .3s !important; }
}
