/* ===== Contractor Management — Modern Compliance theme =====
   Palette: brand red #ED1C24 · charcoal ink #231F20 · steel #5b6067 · paper #f5f6f7
   Type: Barlow Condensed (display) · Source Sans 3 (body) · IBM Plex Mono (stats/credential)
   Source: templates/contractor_management/css/custom.css (#ED1C24 CTA red, #999999 secondary,
   #231F20 dark bg) + templates/contractor_management/css/theme.css (#231F20 footer). See MIGRATION-NOTES.md.
*/
:root {
  --red: #ED1C24;
  --red-dark: #b8141a;
  --ink: #231F20;
  --ink-2: #46484a;
  --steel: #5b6067;
  --steel-light: #8f939a;
  --paper: #f5f6f7;
  --line: #e2e4e6;
  --text: #4b4f54;
  --white: #fff;
  --accent: #5b6067; /* per-site nav accent (contractormanagement = steel grey) */
  --radius: 12px;
  --shadow: 0 8px 28px rgba(35, 31, 32, .12);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Source Sans 3", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}

img { max-width: 100%; height: auto; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 22px; }

h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.12; }
h1 { font-size: clamp(38px, 5.5vw, 58px); font-weight: 700; letter-spacing: .3px; }
h2 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; }
h3 { font-size: 23px; font-weight: 600; }
h4 { color: var(--ink); font-size: 15px; text-transform: uppercase; letter-spacing: 1.2px; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--red); margin-bottom: 14px;
}

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 18px; z-index: 200; }
.skip-link:focus { left: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; font-weight: 600; font-size: 16px; white-space: nowrap;
  border-radius: 8px; padding: 13px 26px; border: 0; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(237, 28, 36, .3); }
.btn-red:hover { background: var(--red-dark); }
.btn-navy { background: var(--ink); color: #fff; }
.btn-navy:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-white { background: #fff; color: var(--red); }
.btn-outline-white { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.55); }
.btn-outline-white:hover { border-color: #fff; }

/* ===== Header ===== */
.site-header { position: relative; z-index: 100; }

/* Utility strip */
.topbar { background: var(--ink); color: #cfe0ee; }
.topbar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; min-height: 40px; flex-wrap: wrap;
}
.topbar-tag {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 2px;
  text-transform: uppercase; color: #8fb8d6;
}
.topbar-tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #4fd08a; box-shadow: 0 0 0 3px rgba(79,208,138,.22);
}
.topbar-links { display: flex; align-items: center; gap: 22px; }
.topbar-links a { color: #cfe0ee; font-weight: 600; font-size: 13px; }
.topbar-links a:hover { color: #fff; text-decoration: none; }
.topbar-phone { font-family: var(--mono); }
.topbar .verify-link { color: #fff; }
.topbar .verify-link::before { content: "✓ "; color: #4fd08a; font-weight: 700; }

/* Main bar (sticky) */
.mainbar {
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  transition: box-shadow .2s ease;
}
.mainbar.scrolled { box-shadow: 0 8px 26px rgba(22,50,74,.10); }
.header-row { display: flex; align-items: center; gap: 22px; height: 74px; }
.brand { margin-right: auto; display: flex; }
.brand img { display: block; width: auto; max-height: 58px; }

.main-nav { display: flex; align-items: center; gap: 14px; }
#nav-menu { list-style: none; display: flex; align-items: center; gap: 2px; }
#nav-menu > li > a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink); font-weight: 600; font-size: 15.5px;
  padding: 9px 14px; border-radius: 9px;
}
#nav-menu > li > a:hover { color: var(--accent); background: var(--paper); text-decoration: none; }
.caret { font-size: 10px; color: var(--accent); transition: transform .2s ease; }
#nav-menu > li.has-sub.open > a { color: var(--accent); background: var(--paper); }
#nav-menu > li.has-sub.open > a .caret { transform: rotate(180deg); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions .btn { padding: 11px 22px; font-size: 15px; }
.nav-toggle { display: none; }

/* Dropdown — click-open, no dead gap */
.has-sub { position: relative; }
.has-sub .sub {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 266px;
  list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); flex-direction: column; gap: 0; padding: 9px;
}
.has-sub .sub::before {
  content: ""; position: absolute; top: -1px; left: 16px; right: 16px; height: 3px;
  border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--red));
}
.has-sub.open .sub { display: flex; }
.sub li a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 15px; color: var(--ink); }
.sub li a:hover { background: var(--paper); color: var(--accent); text-decoration: none; }

/* Mobile drawer overlay — z-index below .site-header (100) so the drawer,
   which lives inside the header's stacking context, still paints on top */
.nav-overlay {
  position: fixed; inset: 0; background: rgba(15,30,45,.5);
  opacity: 0; visibility: hidden; transition: opacity .25s ease; z-index: 90;
}
.nav-overlay.show { opacity: 1; visibility: visible; }

/* Drawer close button (injected by JS; only shown inside the mobile drawer) */
.nav-close {
  display: none; position: absolute; top: 14px; right: 16px;
  width: 40px; height: 40px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--paper); color: var(--ink); font-size: 26px; line-height: 1;
}
.nav-close:hover { background: var(--line); }

/* ===== Page hero (inner pages) ===== */
.page-hero {
  background: linear-gradient(135deg, var(--ink) 0%, #3b3436 90%);
  padding: 58px 0 54px; color: #fff;
}
.page-hero h1 { color: #fff; font-size: clamp(32px, 4.5vw, 46px); max-width: 900px; }
.page-hero .eyebrow { color: #ff9195; margin-bottom: 8px; }

/* ===== Content pages ===== */
.page-wrap { max-width: 860px; margin: 0 auto; padding: 54px 22px 80px; }
.page-wrap p { margin-bottom: 20px; }
.page-wrap ul, .page-wrap ol { margin: 0 0 20px 26px; }
.page-wrap li { margin-bottom: 8px; }
.page-wrap strong { color: var(--ink); }
.page-title { color: var(--ink); margin: 10px 0 24px; }
.section-title { color: var(--ink); font-size: 27px; margin: 38px 0 16px; }
.lead-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); margin: 4px 0 30px; aspect-ratio: 1150 / 350; object-fit: cover; }

/* ===== HOME ===== */

/* Hero */
.hero {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(237,28,36,.08), transparent 60%),
    linear-gradient(180deg, var(--paper), #fff);
  padding: 84px 0 70px; overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero .lead { font-size: 20px; margin: 22px 0 30px; max-width: 520px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 14.5px; color: var(--ink-2); }
.hero-note strong { color: var(--ink); }

/* Signature: CSS-drawn compliance clipboard / checklist card */
.clipboard-scene { display: flex; justify-content: center; position: relative; }
.clipboard {
  width: 330px; background: #fff; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(35,31,32,.24);
  transform: rotate(-3deg);
  border: 1px solid var(--line);
  position: relative;
  padding-top: 22px;
}
.clip {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 30px; border-radius: 8px;
  background: linear-gradient(180deg, #c7cbcf, var(--steel));
  box-shadow: 0 6px 10px rgba(35,31,32,.25);
}
.clip::before {
  content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 8px; border-radius: 4px; background: rgba(0,0,0,.18);
}
.board-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 20px 14px; border-bottom: 2px solid var(--paper);
}
.board-head img { width: 84px; }
.board-stamp {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.3px;
  color: #2f8a4c; border: 2px solid #2f8a4c; border-radius: 6px;
  padding: 3px 7px; transform: rotate(-4deg); text-transform: uppercase;
}
.board-list { padding: 16px 22px 10px; }
.check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.check-row .box {
  flex: none; width: 18px; height: 18px; border-radius: 5px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.check-row .bar { flex: 1; height: 9px; border-radius: 5px; background: var(--paper); }
.check-row .bar.w-70 { width: 70%; flex: none; }
.check-row .bar.w-85 { width: 85%; flex: none; }
.board-foot {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ink); border-radius: 0 0 13px 13px; padding: 12px 20px; margin-top: 6px;
}
.board-foot .verified { color: #ff9195; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; }
.board-bars { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.board-bars span { width: 3px; background: #fff; opacity: .85; }
.board-bars span:nth-child(odd) { height: 100%; }
.board-bars span:nth-child(even) { height: 60%; }
.board-bars span:nth-child(3n) { height: 80%; }

/* Stats band */
.stats { background: var(--ink); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { text-align: center; padding: 34px 12px; }
.stat + .stat { border-left: 1px solid rgba(255,255,255,.12); }
.stat-num { font-family: var(--mono); font-size: 36px; color: #fff; }
.stat-label { font-size: 13.5px; letter-spacing: 1.6px; text-transform: uppercase; color: #c9ccce; margin-top: 4px; }

/* Section scaffolding */
.sec { padding: 84px 0; }
.sec-alt { background: var(--paper); }
.sec-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.sec-head p { margin-top: 12px; font-size: 18px; }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.step-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
}
.step-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.step-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.step-body { padding: 22px 24px 26px; }
.step-num {
  font-family: var(--mono); font-size: 13px; color: var(--red);
  letter-spacing: 2px; display: block; margin-bottom: 8px;
}
.step-body h3 { margin-bottom: 10px; }
.step-body p { font-size: 15.5px; }

/* Services / products */
.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.prod-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.prod-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); text-decoration: none; }
.prod-price { font-family: var(--mono); color: var(--ink); font-size: 15px; margin: 2px 0 12px; }
.prod-card h3 { font-size: 21px; }
.prod-card p { font-size: 15px; flex: 1; }
.prod-more { color: var(--red); font-weight: 600; font-size: 15px; margin-top: 14px; }

/* Why band */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.why-img img { border-radius: var(--radius); box-shadow: var(--shadow); }
.why-list { list-style: none; margin: 26px 0 30px; }
.why-list li { padding-left: 34px; position: relative; margin-bottom: 13px; color: var(--ink-2); font-weight: 600; }
.why-list li::before {
  content: "✓"; position: absolute; left: 0; top: -1px;
  width: 24px; height: 24px; line-height: 24px; text-align: center;
  border-radius: 50%; background: var(--red); color: #fff; font-size: 13px;
}

/* Testimonials */
.testi { background: linear-gradient(160deg, var(--ink), #100e0e); }
.testi .sec-head h2, .testi .sec-head p { color: #fff; }
.testi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.tcard {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 28px;
}
.tcard > p { color: #e6e3e3; font-size: 16px; font-style: italic; }
.tcard .by { display: flex; align-items: center; gap: 13px; margin-top: 18px; }
.tcard .by img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.tcard .by strong { color: #fff; display: block; font-size: 14.5px; }
.tcard .by span { color: #c9ccce; font-size: 13.5px; }

/* CTA strip */
.cta-strip { background: linear-gradient(120deg, var(--red), #7c0e13); color: #fff; text-align: center; padding: 76px 0; }
.cta-strip h2 { color: #fff; }
.cta-strip p { color: #ffd3d5; font-size: 18px; margin: 14px auto 30px; max-width: 560px; }
.cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.cta-center { text-align: center; margin: 34px 0 8px; }

/* ===== Product / inner pages ===== */
.check-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; list-style: none; margin: 0 0 24px; }
.check-cols li { padding-left: 30px; position: relative; color: var(--ink-2); font-weight: 600; margin: 0; }
.check-cols li::before {
  content: "✓"; position: absolute; left: 0; top: 1px;
  width: 21px; height: 21px; line-height: 21px; text-align: center;
  border-radius: 50%; background: var(--red); color: #fff; font-size: 12px;
}

/* FAQ accordion-style list */
.faq-list { list-style: none; margin: 0; }
.faq-item { border-bottom: 1px solid var(--line); padding: 22px 0; }
.faq-item:first-child { padding-top: 0; }
.faq-q { color: var(--ink); font-weight: 700; font-size: 18px; margin-bottom: 8px; }

/* ===== Contact ===== */
.contact-form { max-width: 620px; }
.contact-form label { display: block; color: var(--ink); font-weight: 600; font-size: 14.5px; margin: 16px 0 5px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--red); outline: none; }
.contact-form textarea { min-height: 150px; }
.hp-field { display: none; }
.contact-form button { margin-top: 20px; }

/* ===== Homepage video ===== */
.video-frame {
  position: relative; max-width: 880px; margin: 8px auto 0;
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: #000;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===== Footer ===== */
.site-footer { background: var(--ink); color: #c9ccce; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding: 62px 22px 50px; }
.f-col h4 { color: #fff; margin-bottom: 16px; }
.f-about img { margin-bottom: 14px; }
.f-about p { margin-bottom: 12px; }
.f-phone a { font-family: var(--mono); color: #fff; font-size: 19px; }
.f-mail { color: #ff9195; }
.f-list { list-style: none; }
.f-list li { margin-bottom: 9px; }
.f-list a { color: #c9ccce; }
.f-list a:hover { color: #fff; }
.f-verify { display: flex; gap: 14px; align-items: center; margin-top: 18px; background: rgba(255,255,255,.06); border-radius: 10px; padding: 14px; }
.f-verify img { border-radius: 50%; }
.f-verify p { font-size: 13.5px; line-height: 1.5; }
.f-verify strong { color: #fff; }

.sub-footer { border-top: 1px solid rgba(255,255,255,.12); }
.sub-row { display: flex; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 24px; font-size: 13.5px; flex-wrap: wrap; }
.powered a { color: #ff9195; }

/* ===== 404 ===== */
.notfound { text-align: center; padding: 110px 22px 130px; }
.notfound .code { font-family: var(--mono); font-size: 15px; color: var(--red); letter-spacing: 3px; }
.notfound h1 { margin: 10px 0 14px; }
.notfound p { margin-bottom: 28px; }

/* ===== Responsive ===== */
@media (min-width: 981px) { .nav-overlay { display: none; } }

@media (max-width: 980px) {
  .topbar-tag { display: none; }
  .header-row { height: 64px; }
  .brand img { max-height: 48px; }
  /* Blur creates a containing block for position:fixed — drop it on mobile
     so the slide-in drawer anchors to the viewport, not the header bar. */
  .mainbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }

  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 42px; flex-direction: column; gap: 4px;
    background: var(--ink); color: #fff; border: 0; border-radius: 10px;
    cursor: pointer; order: 3;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }

  #nav-menu {
    display: none; position: fixed; top: 0; right: 0; bottom: 0;
    width: min(342px, 86vw); flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; box-shadow: -14px 0 44px rgba(22,50,74,.20);
    padding: 74px 16px 26px; overflow-y: auto; z-index: 120;
    transform: translateX(100%); transition: transform .26s ease;
  }
  #nav-menu.open { display: flex; transform: translateX(0); }
  .nav-close { display: block; }
  #nav-menu > li > a { font-size: 17px; padding: 14px 16px; border-radius: 10px; }
  .has-sub .sub {
    position: static; box-shadow: none; border: 0; padding: 2px 0 8px 16px;
    min-width: 0; border-radius: 0;
  }
  .has-sub .sub::before { display: none; }
  .nav-actions { order: 2; }
  .nav-actions .btn { padding: 9px 16px; }

  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .clipboard-scene { order: -1; }
  .clipboard { width: 300px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid rgba(255,255,255,.12); }
  .steps-grid { grid-template-columns: 1fr; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .testi-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  /* S1 hero */
  .hero-grid > div:first-child { text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-btns { justify-content: center; }
  /* S3 why */
  .why-grid > div:first-child { text-align: center; }
  .why-list { width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; text-align: left; }
}

@media (max-width: 560px) {
  .prod-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .check-cols { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .sec { padding: 60px 0; }
  .hero { padding: 54px 0 50px; }
  /* S2 buttons */
  .hero-btns, .cta-btns { flex-direction: column; align-items: stretch; }
  .hero-btns .btn, .cta-btns .btn { width: 100%; text-align: center; }
  .why-grid .btn { white-space: normal; text-align: center; }
  /* S4 footer */
  .f-col { text-align: center; }
  .f-about > img, .f-brand-logo { display: block; margin-left: auto; margin-right: auto; }
  .f-verify { justify-content: center; }
  .sub-row { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
}
