/* Mobile & tablet layout for the CheckA+ marketing site.
   The pages use inline styles, so these rules use attribute selectors + !important. */

img, svg, video { max-width: 100%; }
img { height: auto; }
html, body { overflow-x: hidden; }
* { min-width: 0; }

/* ---------- Tablet (≤ 900px) ---------- */
@media (max-width: 900px) {
  *, *::before, *::after { box-sizing: border-box; }
  /* two-column feature/hero rows stack */
  [style*="grid-template-columns:minmax(0,1fr) minmax"],
  [style*="grid-template-columns:1.4fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  [style*="grid-template-columns:repeat(4,1fr)"]:not([style*="gap:8px"]),
  [style*="grid-template-columns:repeat(3,1fr)"]:not([style*="gap:6px"]) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* footer: brand full width, link columns in a row */
  footer [style*="grid-template-columns:1.4fr"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 28px !important; }
  footer [style*="grid-template-columns:1.4fr"] > div:first-child { grid-column: 1 / -1; }
}

/* ---------- Phone (≤ 640px) ---------- */
@media (max-width: 640px) {
  /* side gutters */
  section, footer > div, header > div,
  [style*="padding:64px 24px"], [style*="padding:56px 24px"], [style*="padding:48px 24px"],
  [style*="padding:40px 24px"], [style*="padding:24px 24px"], [style*="padding:0 24px"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  section, [style*="padding:64px 24px"] { padding-top: 40px !important; padding-bottom: 40px !important; }
  [style*="padding:64px 24px 56px"] { padding-top: 32px !important; }

  /* every grid becomes one column, except small icon/thumbnail rows */
  [style*="grid-template-columns"]:not([style*="gap:6px"]):not([style*="gap:8px"]) { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:repeat(4,1fr)"][style*="gap:8px"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  [style*="grid-template-columns:repeat(3,1fr)"][style*="gap:6px"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  footer [style*="grid-template-columns:1.4fr"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* headings */
  h1 { font-size: 30px !important; line-height: 1.15 !important; }
  h2 { font-size: 24px !important; line-height: 1.2 !important; }
  h3 { font-size: 18px !important; }
  p { font-size: 15px; }

  /* rows of buttons / badges wrap instead of squeezing */
  [style*="display:flex"]:has(> a + a), [style*="display:flex"]:has(> button + a), [style*="display:flex"]:has(> a + button),
  [style*="display:flex"]:has(> span + span):not(label), [style*="display:flex"]:has(> div + div):not(:has(> svg)) { flex-wrap: wrap; }
  header [style*="display:flex"] { flex-wrap: nowrap !important; }
  a[style*="padding:13px"], a[style*="padding:14px"], a[style*="padding:12px 22px"], button[style*="padding:13px"] { white-space: nowrap; }

  /* fixed-width mockups shrink to the screen */
  [style*="width:440px"], [style*="width:560px"], [style*="width:300px"], [style*="minmax(280px"] { max-width: 100% !important; }
  [style*="position:absolute"][style*="right:-"], [style*="position:absolute"][style*="left:-"] { display: none !important; }
  [style*="transform:rotate"] { transform: none !important; }

  /* tables scroll inside their box */
  table { font-size: 13px; }

  /* cards and forms: less padding */
  [style*="padding:32px"] { padding: 20px !important; }
  [style*="padding:28px"] { padding: 20px !important; }
  [style*="padding:38px 34px"] { padding: 28px 20px !important; }

  /* sign-up stepper labels: numbers only */
  #stepper span { display: none; }
}
