/*
 * InsQuotesNow polish layer
 * Loaded after css/style.css AND the NICRIS Quote plugin stylesheet (see functions.php),
 * so these rules win without editing either file. Plugin updates will not overwrite this file.
 *
 * Guardrail: this file only changes layout, spacing and colour. It never hides or shrinks
 * form fields, consent text or licensing notices, and it targets no field names or IDs.
 */

:root {
  --iqn-navy: #084068;
  --iqn-blue: #0C71C3;
  --iqn-blue-dark: #095a9c;
  --iqn-sky: #2EA3F2;
  --iqn-red: #D63637;
  --iqn-band: #F4F6F8;
  --iqn-ink: #1f2a33;
  --iqn-muted: #5b6670;
  --iqn-radius: 10px;
  --iqn-gutter: 16px;
}

body { background: #fff; color: var(--iqn-ink); -webkit-text-size-adjust: 100%; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--iqn-sky); outline-offset: 2px; }

/* ---------------------------------------------------------------- header */
header:not(.nqf-head) { padding: 12px 0; position: relative; z-index: 10; }
header:not(.nqf-head) .container { flex-wrap: wrap; gap: 8px 24px; }
/* Logo inherited the global link blue (#0C71C3 on navy is hard to read). */
header .logo a { color: #fff; letter-spacing: -.01em; }
header .logo a:hover { color: var(--iqn-sky); text-decoration: none; }
header nav { display: flex; align-items: center; gap: 4px; }
header nav a { margin-left: 0; padding: 10px 12px; border-radius: 6px; line-height: 1.2; }
header nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--iqn-sky); }
header nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }

@media (max-width: 700px) {
  .container { padding: 0 var(--iqn-gutter); }
  header:not(.nqf-head) { padding: 10px 0 0; }
  header:not(.nqf-head) .container { gap: 2px; }
  header .logo { font-size: 1.3rem; }
  /* The theme hid the menu entirely on phones; bring it back as a compact, swipeable row. */
  header nav {
    display: flex; width: 100%; margin: 0 calc(var(--iqn-gutter) * -1);
    width: calc(100% + var(--iqn-gutter) * 2); padding: 0 calc(var(--iqn-gutter) - 10px) 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  header nav::-webkit-scrollbar { display: none; }
  header nav a { flex: 0 0 auto; font-size: .9rem; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 10px; }
}

/* ------------------------------------------------------------------ hero */
.hero {
  background:
    linear-gradient(180deg, rgba(8,64,104,.86) 0%, rgba(8,64,104,.72) 100%),
    url('../../images/hero.jpg') center 30%/cover no-repeat;
  padding: 56px 0 96px;
}
.hero h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.9rem); line-height: 1.15; letter-spacing: -.015em;
  max-width: 22ch; margin: 0 auto 12px; text-wrap: balance;
}
.hero p { max-width: 60ch; margin: 0 auto; font-size: 1.05rem; color: rgba(255,255,255,.92); }
.hero p.sub { font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; margin-bottom: 12px; color: #fff; }

/* Trust chips in the hero (markup added in front-page.php) */
.hero-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin: 20px auto 0; padding: 0; list-style: none; }
.hero-trust li {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); font-size: .88rem; font-weight: 600; color: #fff;
}
.hero-trust li::before { content: "\2713"; color: var(--iqn-sky); font-weight: 800; }

@media (max-width: 700px) {
  .hero { padding: 28px 0 56px; text-align: center; }
  .hero h1 { font-size: 1.7rem; margin-bottom: 8px; }
  .hero p.sub { font-size: .98rem; margin-bottom: 8px; }
  .hero p:not(.sub) { font-size: .95rem; line-height: 1.5; }
  .hero-trust { margin-top: 14px; gap: 6px; }
  .hero-trust li { font-size: .8rem; padding: 4px 10px; }
}

/* --------------------------------------------- quote section + layout */
/* Pull the form up so it overlaps the hero and starts above the fold on phones. */
.home .hero + .section { padding-top: 0; background: linear-gradient(var(--iqn-band), #fff 600px); }
.home .hero + .section > .container { position: relative; margin-top: -72px; }

/* .form-box used to add a second white card + padding around the plugin's own card,
   which squeezed inputs to ~247px on a 375px phone. Let the plugin card be the only card. */
.form-box {
  max-width: 760px; margin: 0 auto; padding: 0; background: none; box-shadow: none; border-radius: 0;
}
.form-box > .nqf { padding: 0; background: transparent; }
.form-box .nqf-card {
  border-top-width: 5px; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(8,64,104,.08), 0 18px 40px rgba(8,64,104,.14);
}

@media (max-width: 700px) {
  .home .hero + .section { padding-bottom: 32px; }
  .home .hero + .section > .container { margin-top: -40px; padding: 0 10px; }
  .form-box .nqf-card { padding-left: 14px; padding-right: 14px; }
  .form-box .nqf .nqf-progress { margin-left: -14px; margin-right: -14px; }
  .form-box .nqf .nqf-nav { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
}

/* Desktop: form + trust sidebar side by side. */
@media (min-width: 1024px) {
  .home .hero + .section > .container:has(> .form-box) {
    display: grid; grid-template-columns: minmax(0, 720px) 300px; justify-content: center; align-items: start; gap: 32px;
  }
  .home .hero + .section > .container:has(> .form-box) > .form-box { margin: 0; max-width: none; }
  .home .hero + .section > .container:has(> .form-box) > .benefits {
    position: sticky; top: 24px; margin-top: 88px; grid-template-columns: 1fr; gap: 12px;
  }
}

/* ------------------------------------------------------- form polish */
.form-box .nqf .nqf-title { letter-spacing: -.015em; }
.form-box .nqf .nqf-lede { font-size: 15px; }

/* Progress steps: on phones, show the current step name + numbered dots; never wrap or overflow. */
.form-box .nqf .nqf-steps { align-items: center; gap: 6px; flex-wrap: nowrap; }
.form-box .nqf .nqf-step-ind { min-width: 0; }
.form-box .nqf .nqf-step-ind[aria-current="step"] { flex: 1 1 auto; }
.form-box .nqf .nqf-step-ind[aria-current="step"] .nqf-step-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) {
  .form-box .nqf .nqf-step-name { white-space: nowrap; }
}

/* Coverage tiles: compact, icon-left cards.
   Phones (<560px): one per row, 64px+ tall.  560px and up: balanced 2 x 2 grid.
   (The plugin switches to 4 across at 760px viewport, which overflowed the 600px theme box on desktop.) */
.form-box .nqf .nqf-tiles { grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .form-box .nqf .nqf-tiles { grid-template-columns: 1fr 1fr; gap: 12px; } }
.form-box .nqf .nqf-tile-body {
  grid-template-columns: 40px 1fr; grid-template-rows: auto auto; row-gap: 2px; column-gap: 12px;
  align-items: center; align-content: center; min-height: 72px; padding: 12px 40px 12px 14px;
}
.form-box .nqf .nqf-tile-icon { grid-row: span 2; margin-bottom: 0; }
.form-box .nqf .nqf-tile-label { font-size: 16px; }
.form-box .nqf .nqf-tile-desc { font-size: 13.5px; }
.form-box .nqf .nqf-tile-check { top: 50%; transform: translateY(-50%); }

/* Touch targets: plugin "Edit" links on the review step are 32px tall. */
.form-box .nqf .nqf-review-head .nqf-btn-text { min-height: 44px; padding: 10px 4px; }
.form-box .nqf .nqf-btn-text { min-height: 44px; }

/* iOS Safari zooms any field under 16px. The plugin already uses 16px; this guards against theme overrides. */
@media (max-width: 700px) {
  .form-box .nqf input:not([type="checkbox"]):not([type="radio"]),
  .form-box .nqf select,
  .form-box .nqf textarea { font-size: 16px; }
}

/* Buttons: blue = next step, red = final submit (plugin colours kept, a little more presence). */
.form-box .nqf .nqf-btn-primary,
.form-box .nqf .nqf-btn-submit { box-shadow: 0 2px 0 rgba(0,0,0,.08); letter-spacing: .01em; }
.form-box .nqf .nqf-btn-submit { font-size: 17px; }

/* Compliance copy stays full size and readable; only line length/contrast are tuned. */
.form-box .nqf .nqf-consent-text { color: #333; }
.form-box .nqf .nqf-footer-notice { color: #4a545d; font-size: 13px; line-height: 1.5; }

/* ----------------------------------------------- trust / benefits */
.benefits { margin-top: 24px; gap: 12px; }
.benefit {
  position: relative; text-align: left; padding: 16px 16px 16px 52px; border: 1px solid #e3e8ee;
  border-radius: var(--iqn-radius); box-shadow: 0 1px 2px rgba(8,64,104,.05); line-height: 1.45; font-size: .93rem; color: var(--iqn-muted);
}
.benefit strong { color: var(--iqn-navy); font-size: 1rem; }
.benefit::before {
  content: "\2713"; position: absolute; left: 16px; top: 16px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--iqn-navy); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.benefits-title { grid-column: 1 / -1; color: var(--iqn-navy); font-size: 1.15rem; margin: 0 0 4px; }
@media (max-width: 700px) {
  .benefits { grid-template-columns: 1fr 1fr; gap: 10px; }
  .benefit { padding: 44px 12px 12px; font-size: .85rem; }
  .benefit::before { left: 12px; top: 12px; }
  .benefit strong { font-size: .92rem; }
}

/* ---------------------------------------------- SEO content block */
.ny-coverage { padding: 48px 0 56px; background: #fff; }
.ny-coverage h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); line-height: 1.2; margin-bottom: 8px; }
.ny-coverage > .container > p { color: var(--iqn-muted); max-width: 70ch; margin-bottom: 20px; }
.ny-coverage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.ny-coverage-grid article { border: 1px solid #e3e8ee; border-radius: var(--iqn-radius); padding: 18px; }
.ny-coverage-grid h3 { color: var(--iqn-navy); font-size: 1.05rem; margin: 0 0 6px; }
.ny-coverage-grid p { font-size: .93rem; color: var(--iqn-muted); }
.ny-coverage .btn { margin-top: 24px; }

/* Inner pages: first heading becomes the page <h1> (see notes); keep it the same size as before. */
.section > .container > h1:first-child { color: var(--iqn-navy); font-size: 2rem; line-height: 1.2; margin-bottom: 20px; }

/* ----------------------------------------------------- buttons + footer */
.btn { background: var(--iqn-red); border-radius: 6px; min-height: 48px; padding: 14px 28px; }
.btn:hover { background: #b42a2b; }
.btn:focus-visible { outline: 3px solid var(--iqn-sky); outline-offset: 2px; }

footer { padding: 32px 0; line-height: 1.6; }
footer p { max-width: 75ch; margin-left: auto; margin-right: auto; }
footer a { display: inline-block; padding: 6px 2px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
