/* Responsive layer for the Cyrix site. Added to every page by build/build.py.
   The canvas pages are 1440px artboards with inline styles, so overrides here
   target those inline declarations and need !important. */

/* ---------- All widths ---------- */
#page { width: 100% !important; height: auto !important; overflow-x: hidden; }
.nav-toggle { display: none; }

/* Card titles are h4 in the canvas; the build makes them h3 (heading order) and keeps the h4 look */
h3.h4 { font-size: 18px; letter-spacing: normal; }
.footer h3.h4 { color: #EEF4F6; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 18px; }

/* Partner strip: full-strength text so the insurer names meet 4.5:1 contrast */
.ptntrack span { opacity: 1 !important; }

/* Contact form (replaces the canvas mock-up; same visual language) */
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 24px; margin-top: 38px; }
.cf-field { border: 0; min-width: 0; }
.cf-wide { grid-column: 1 / -1; }
.cf-field label, .cf-field legend {
  display: block; font-family: 'General Sans', sans-serif; font-weight: 600;
  font-size: 15px; color: #0F1B3A; margin-bottom: 10px; padding: 0;
}
.cf-field input, .cf-field select, .cf-field textarea {
  width: 100%; height: 60px; border-radius: 12px; border: 1.5px solid rgba(15,27,58,0.12);
  background: #FFFFFF; padding: 0 20px; font: 500 16px 'Inter', sans-serif; color: #0F1B3A;
  -webkit-appearance: none; appearance: none;
}
.cf-field textarea { height: auto; min-height: 112px; padding: 17px 20px; resize: vertical; line-height: 1.5; }
.cf-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A5C78' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center; padding-right: 56px;
}
.cf-field select:invalid { color: #6B7A92; }
.cf-field ::placeholder { color: #6B7A92; opacity: 1; }
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus {
  outline: none; border-color: #0B9A82; box-shadow: 0 0 0 3px rgba(25,214,177,0.22);
}
.cf-checked .cf-field input:invalid, .cf-checked .cf-field select:invalid,
.cf-checked .cf-chips:has(input:invalid) .cf-chip span { border-color: #C2410C; }
.cf-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cf-chip { position: relative; margin: 0 !important; cursor: pointer; }
.cf-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.cf-chip span {
  display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 15px 6px;
  border-radius: 11px; background: #FFFFFF; border: 1px solid rgba(15,27,58,0.08);
  font-family: 'General Sans', sans-serif; font-weight: 600; font-size: 14px; color: #0F1B3A; text-align: center;
}
.cf-chip input:checked + span { background: rgba(25,214,177,0.14); border-color: #0B9A82; color: #0B6E5E; }
.cf-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(25,214,177,0.35); }
.cf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form button { border: 0; cursor: pointer; }
.contact-form button[disabled] { opacity: 0.6; cursor: wait; }
.cf-status { margin-top: 14px; font-size: 14px !important; text-align: center; font-weight: 600; }
.cf-status:empty { display: none; }
.cf-status.cf-ok { color: #0B6E5E !important; }
.cf-status.cf-error { color: #C2410C !important; }

/* ---------- Tablet and below ---------- */
@media (max-width: 1100px) {
  .grid-4, .grid-6, [style*="grid-template-columns:repeat(5,1fr)"] { grid-template-columns: repeat(3, 1fr) !important; }
  [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2 { gap: 40px !important; }
}

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1.3fr 1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns:1.3fr 1fr 1fr 1fr"] > :first-child { grid-column: 1 / -1; }
  [style*="grid-template-columns:repeat(3,1fr)"] { grid-template-columns: 1fr !important; }

  /* Mobile navigation */
  .navbar .container { display: flex !important; justify-content: space-between; flex-wrap: wrap; }
  .navbar [style*="margin-left:-546px"] { display: none; } /* desktop-width hexagon rail */

  /* Light heroes: the text column goes full width (build.py centres it on larger screens) */
  .hero > div[style*="position:relative"][style*="margin-left:"] {
    margin-left: 0 !important; width: auto !important; max-width: 680px;
    padding-left: 24px !important; padding-right: 24px !important;
  }

  /* Contact card: form column above the side panel */
  .cf-card { grid-template-columns: 1fr !important; }
  .cf-card > :nth-child(2) { border-left: 0 !important; border-top: 1px solid rgba(15,27,58,0.08); }
  .nav-links, .nav-cta { display: none !important; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 11px; border: 1.5px solid rgba(238,244,246,0.14);
    border-radius: 10px; background: transparent; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: #EEF4F6; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-open .nav-links {
    display: flex !important; order: 3; width: 100%; flex-direction: column;
    align-items: stretch !important; gap: 0 !important; padding-top: 12px;
  }
  .nav-open .nav-links .navlink {
    display: block; padding: 14px 0; font-size: 17px; opacity: 1;
    border-top: 1px solid rgba(238,244,246,0.1);
  }
  .nav-open .nav-links .nv-pulse { display: none !important; }
  .nav-open .nav-cta { display: flex !important; order: 4; width: 100%; margin: 8px 0 4px; height: 50px !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .container { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="margin:0 -44px"] { margin-left: -20px !important; margin-right: -20px !important; padding-left: 20px !important; padding-right: 20px !important; }

  /* Vertical rhythm */
  [style*="padding:104px 0"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  [style*="padding:68px 0"] { padding-top: 44px !important; padding-bottom: 44px !important; }
  [style*="padding-top:88px"], [style*="padding-top:80px"] { padding-top: 48px !important; }
  [style*="padding-bottom:96px"] { padding-bottom: 64px !important; }
  [style*="padding:88px 44px"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  [style*="padding:76px 44px 40px"] { padding-top: 52px !important; }
  [style*="min-height:"] { min-height: 0 !important; }
  [style*="margin-top:52px"], [style*="margin-top:48px"] { margin-top: 36px !important; }

  /* Type */
  h1 { font-size: 38px !important; letter-spacing: -0.3px !important; }
  h2 { font-size: 29px !important; }
  h3:not(.h4) { font-size: 21px !important; }
  .lede { font-size: 17.5px !important; }
  .eyebrow + h2 { margin-top: 12px !important; }
  h2 + p.lede { margin-top: 16px !important; }
  p { font-size: 16px; }
  .stat-num { font-size: 28px !important; letter-spacing: -0.8px !important; }
  [style*="font-size:30px"] { font-size: 22px !important; }
  [style*="font-size:28px"] { font-size: 24px !important; }

  /* Navbar logo */
  .navbar [style*="font-size:40px"] { font-size: 28px !important; }
  .navbar .logo-mark { width: 35px; height: 40px; }
  .navbar [style*="gap:21px"] { gap: 13px !important; }
  .navbar { padding: 12px 0 !important; }

  /* Grids collapse */
  /* stat rows and chips stay two-up; card grids go single column */
  [style*="grid-template-columns:repeat(4,1fr)"], .grid-6 { grid-template-columns: 1fr 1fr !important; }
  .grid-4, [style*="grid-template-columns:repeat(5,1fr)"] { grid-template-columns: 1fr !important; }
  .card [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1.3fr 1fr 1fr 1fr"] { gap: 28px 20px !important; }

  /* Hero */
  [style*="max-width:460px"] { max-width: 280px !important; }
  [style*="max-width:300px"][style*="margin:0 auto"] { max-width: 220px !important; }
  [style*="gap:16px;margin-top:38px"] { flex-direction: column; align-items: stretch; gap: 12px !important; margin-top: 30px !important; }
  .pill { max-width: 100%; white-space: normal; text-align: left; }

  /* Three-step flow: stack with downward arrows */
  [style*="display:flex;align-items:stretch;gap:4px"] { flex-direction: column; gap: 6px !important; }
  [style*="display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px"] { width: 100% !important; height: 30px; }
  [style*="display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px"] svg { transform: rotate(90deg); }

  /* Rounded dark panels (e.g. "Why Cyrix exists" + Risk Signal feed) */
  [style*="border-radius:24px"][style*="padding:"] { padding: 36px 18px !important; border-radius: 18px !important; }
  [style*="border-radius:24px"] h2 { font-size: 26px !important; line-height: 1.15 !important; }
  [style*="padding:56px 0"], [style*="padding:40px 0"] { padding-top: 32px !important; padding-bottom: 32px !important; }
  [style*="padding:22px 22px 4px"] { padding: 18px 14px 4px !important; }
  [class$="pfwrap"] { height: 300px !important; }
  [class$="pfwrap"] [style*="gap:14px"] { gap: 10px !important; padding-left: 0 !important; padding-right: 0 !important; }
  [class$="pfwrap"] [style*="width:60px"] { width: 54px !important; padding-left: 4px !important; padding-right: 4px !important; }
  [class$="pfwrap"] [style*="font-size:14.5px"] { font-size: 14px !important; line-height: 1.35; }

  /* Cards */
  .card, .card-dark { padding: 26px 22px !important; }
  [style*="padding:36px 32px"] { padding: 28px 22px !important; }
  [style*="padding:26px 28px;display:flex;justify-content:space-between"] { flex-wrap: wrap; gap: 12px; }
  .btn { white-space: normal; text-align: center; min-height: 52px; height: auto !important; padding-top: 12px !important; padding-bottom: 12px !important; }

  /* Contact form */
  .cf-card { padding: 0 !important; }
  .cf-card > div { padding: 32px 22px !important; }
  .contact-form h3 { font-size: 28px !important; }
  .cf-grid { grid-template-columns: 1fr; gap: 18px; margin-top: 26px; }
  .cf-field input, .cf-field select { height: 54px; }
  .cf-chips { grid-template-columns: repeat(3, 1fr); }
  .cf-field input, .cf-field select, .cf-field textarea { font-size: 16px; } /* stops iOS zoom-on-focus */

  /* Footer bottom bar */
  .footer [style*="justify-content:space-between"] { flex-direction: column; align-items: flex-start !important; }
}

@media (max-width: 380px) {
  h1 { font-size: 33px !important; }
  [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: 1fr !important; }
}
