/* ==========================================================================
   MediMeet — Responsive refinements
   Loaded last so individual components can adapt to the width of the screen
   rather than only shrinking the desktop layout.
   ========================================================================== */

/* ---------- Hero actions ---------- */

/* Long labels such as "Meet the AI Coordinator" cannot share a row with a
   second button on phones, so stack them as full-width touch targets. */
@media (max-width: 560px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero-actions .btn {
    flex: none;
    width: 100%;
    min-width: 0;
  }
}

/* ---------- CTA note ---------- */

/* The dot separators used between notes become orphaned at the start of a
   wrapped line on phones. Stack the notes instead. */
@media (max-width: 560px) {
  .cta-band .cta-note {
    flex-direction: column;
    gap: 0.25rem;
  }

  .cta-band .cta-note span + span::before {
    content: none;
  }
}

/* ---------- Navigation sheet ---------- */

/* Keep the open menu usable on short screens (landscape phones, keyboard
   open) by letting it scroll inside the viewport. */
@media (max-width: 1000px) {
  .nav-menu {
    max-height: calc(100dvh - 6.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- Feature strip ---------- */

/* At very narrow widths a two-column tile grid leaves almost no room for
   the copy. Collapse to one column earlier than the desktop breakpoint. */
@media (max-width: 400px) {
  .feature-strip {
    grid-template-columns: 1fr;
  }

  .feature-tile--wide {
    grid-column: auto;
  }
}

/* ---------- Three-card grids ---------- */

/* Between 721px and 960px the shared grid drops to two columns, which leaves
   the third card stranded. Keep the three-up layout while it still fits. */
@media (min-width: 721px) and (max-width: 960px) {
  .layer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Workflow rail ---------- */

/* The five-step rail is easier to read as a wrapped grid on phones than as a
   clipped horizontal scroller. */
@media (max-width: 560px) {
  .overview-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .ov-step:last-child {
    grid-column: 1 / -1;
  }
}

/* When the overview sits in a narrow column, let the small captions wrap
   instead of truncating them with an ellipsis. */
@media (max-width: 1100px) {
  .ov-step em {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ---------- Forms ---------- */

/* 16px controls stop iOS Safari from zooming in when a field is focused. */
@media (max-width: 720px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }

  .checkbox-field {
    gap: 0.7rem;
    min-height: 40px;
  }

  .checkbox-field input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
  }

  .password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    right: 0.35rem;
    min-width: 48px;
    min-height: 40px;
    padding: 0.35rem 0.55rem;
  }

  .auth-row {
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }
}

/* ---------- Footer ---------- */

/* Give footer links comfortable touch targets without changing the visual
   rhythm of the columns. */
@media (max-width: 720px) {
  .footer-col ul {
    gap: 0;
  }

  .footer-col a,
  .footer-legal a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  .footer-contact a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
  }

  .footer-legal {
    flex-wrap: wrap;
    gap: 0 1.25rem;
  }
}
