/* ============================================
   Legacy Roofing and Exteriors — Global Styles
   Fast, clean, conversion-optimized
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a2744;
  --navy-light: #2a3a5c;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --orange: #ea580c;
  --orange-dark: #c2410c;
  --orange-light: #fed7aa;
  /* WCAG AA-safe orange for TEXT on white/light backgrounds (4.5:1+).
     #ea580c only reaches 3.55:1 and fails AA for body-size text. */
  --orange-text: #b8420b;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --radius: 8px;
}

html { scroll-behavior: smooth; }

/* Screen-reader-only text (keeps visible labels off-screen without hiding them from AT) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--navy); color: var(--white);
  padding: 12px 20px; font-weight: 700; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-800);
  line-height: 1.55;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---- Typography ---- */
h1 { font-size: 2.5rem; line-height: 1.15; font-weight: 800; color: var(--navy); }
h2 { font-size: 2rem; line-height: 1.2; font-weight: 700; color: var(--navy); }
h3 { font-size: 1.35rem; line-height: 1.3; font-weight: 600; color: var(--navy); }
p  { font-size: 1.05rem; color: var(--gray-700); }

/* ---- Layout ---- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section--gray { background: var(--gray-50); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.text-center { text-align: center; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

/* ---- Header / Nav ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  max-width: 1140px;
  margin: 0 auto;
}

.header__logo {
  display: flex;
  align-items: center;
}
.site-logo {
  height: 88px;
  max-height: 88px;
  width: auto;
  display: block;
}
.hero-logo {
  height: 110px;
  width: auto;
  display: block;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
}

.header__nav { display: flex; gap: 22px; align-items: center; flex-wrap: nowrap; }
.header__nav a {
  font-size: .95rem;
  white-space: nowrap;
  font-weight: 500;
  color: var(--gray-700);
  transition: color .2s;
}
.header__nav a:hover, .header__nav a.active { color: var(--orange-text); }

.header__cta {
  display: inline-block;
  background: var(--orange-dark);
  color: var(--white) !important;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s;
}
.header__cta:hover { background: #9a3412; }

.header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
}
.header__hamburger span {
  width: 24px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: .2s;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all .2s;
  border: none;
  text-align: center;
}
.btn--primary { background: var(--orange-dark); color: var(--white); }
.btn--primary:hover { background: #9a3412; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--outline { background: transparent; color: var(--orange-text); border: 2px solid var(--orange-dark); }
.btn--outline:hover { background: var(--orange-dark); color: var(--white); }
.btn--white { background: var(--white); color: var(--navy); }
.btn--white:hover { background: var(--gray-100); }
.btn--large { padding: 18px 40px; font-size: 1.15rem; }

/* ---- Focus States ---- */
a:focus-visible,
.btn:focus-visible,
.header__cta:focus-visible,
.faq-item summary:focus-visible,
.header__hamburger:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 10px 0;
  font-size: .85rem;
}
.breadcrumbs a { color: var(--blue); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; color: var(--gray-300); }
.breadcrumbs .current { color: var(--gray-600); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 80px 0 90px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to top right, var(--white) 49%, transparent 51%);
}
.hero h1 { color: var(--white); font-size: 2.8rem; margin-bottom: 16px; }
.hero p { color: rgba(255,255,255,.9); font-size: 1.15rem; margin-bottom: 24px; max-width: 560px; }
.hero .badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--orange-light);
  margin-bottom: 20px;
}

/* ---- Lead Form — conversion-optimized + dark-mode proof ---- */
.lead-form {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  color-scheme: light only;
}
.lead-form h3, .lead-form .lead-form__title { color: var(--navy); font-size: 1.3rem; margin-bottom: 6px; font-weight: 700; line-height: 1.25; }
.lead-form .lead-form__sub { color: var(--gray-600); font-size: .9rem; margin-bottom: 20px; }
.lead-form .form-group { margin-bottom: 1rem; }
.lead-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937 !important;
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}

.lead-form input[type="text"],
.lead-form input[type="tel"],
.lead-form input[type="email"],
.lead-form input[type="url"],
.lead-form input[type="number"],
.lead-form select,
.lead-form textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background-color: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  border: 1.5px solid #9ca3af !important;
  border-radius: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  color-scheme: light only;
}
.lead-form select { appearance: auto; -webkit-appearance: menulist; }
.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: #f97316 !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.lead-form input::placeholder,
.lead-form textarea::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #6b7280 !important;
}
.lead-form button {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #ffffff;
  background-color: #c2410c;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  margin-top: 0.5rem;
  font-family: inherit;
  transition: background-color 0.15s, transform 0.1s;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.3);
}
.lead-form button:hover { background-color: #9a3412; transform: translateY(-1px); }
.lead-form button:active { transform: translateY(0); }
.lead-form .trust-line,
.lead-form .form-trust {
  text-align: center;
  font-size: 0.8125rem;
  color: #4b5563 !important;
  margin-top: 0.75rem;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .lead-form input, .lead-form select, .lead-form textarea {
    background-color: #ffffff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
  }
  .lead-form label { color: #1f2937 !important; }
  .lead-form input::placeholder, .lead-form textarea::placeholder {
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
  }
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: .95rem; color: var(--gray-600); }

/* ---- Trust Bar ---- */
.trust-bar {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 0;
}
.trust-bar__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.trust-bar__item {
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-700);
  text-decoration: none;
  transition: color .15s;
}
/* These read as claims a visitor wants to verify — Clarity showed people
   clicking them when they were inert <div>s. They are links now, so they get a
   hover cue and a focus ring. */
a.trust-bar__item:hover { color: var(--orange-text); text-decoration: underline; }
a.trust-bar__item:focus-visible { outline: 2px solid var(--orange-dark); outline-offset: 3px; border-radius: 4px; }
a.stars { text-decoration: none; cursor: pointer; display: inline-block; }
a.stars:hover { filter: brightness(.85); }
.neighborhood-tags span a { color: inherit; text-decoration: none; }
.neighborhood-tags span a:hover { text-decoration: underline; }

/* ---- CTA Banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}
.cta-banner h2 { color: var(--white); font-size: 2rem; margin-bottom: 12px; }
.cta-banner p { color: rgba(255,255,255,.9); font-size: 1.05rem; margin-bottom: 22px; }

/* ---- FAQ ---- */
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--white);
}
.faq-item summary {
  padding: 18px 22px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--navy);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.4rem; color: var(--orange-text); font-weight: 700; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item .faq-answer { padding: 0 22px 18px; color: var(--gray-600); font-size: .98rem; line-height: 1.6; }

/* ---- Reviews ---- */
.reviews-summary { color: var(--gray-600); max-width: 640px; margin-left: auto; margin-right: auto; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.review-card {
  background: var(--white);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.review-card .stars { color: #f59e0b; font-size: 1.2rem; margin-bottom: 12px; letter-spacing: 2px; }
.review-card .review-text { font-style: italic; color: var(--gray-700); margin-bottom: 16px; font-size: .98rem; line-height: 1.65; flex: 1; }
.review-card .review-text a { color: var(--blue); text-decoration: none; font-style: normal; }
.review-card .review-meta { font-size: .88rem; color: var(--gray-500); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--gray-200); }
.review-card .review-meta strong { color: var(--navy); }
.review-card .review-meta .review-source { color: var(--blue); text-decoration: none; font-size: .84rem; }
.review-card .review-meta .review-source:hover { text-decoration: underline; }
.review-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
/* Desktop: three per row and a short last row centred, so an odd review count never leaves one card stranded on the left. */
@media (min-width: 1024px) {
  .review-grid { display: flex; flex-wrap: wrap; justify-content: center; }
  .review-grid > .review-card { width: calc((100% - 48px) / 3); }
}

/* ---- Checklist ---- */
.checklist li {
  padding: 8px 0;
  font-size: 1.02rem;
  color: var(--gray-700);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checklist li::before {
  content: '\2013';
  color: var(--navy);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---- Neighborhood ---- */
.neighborhood-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.neighborhood-tags span {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* ---- Image Placeholder ---- */
.img-placeholder {
  background: var(--gray-200);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  font-size: .9rem;
  font-weight: 500;
  min-height: 260px;
}

/* ---- Footer ---- */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 60px 0 30px;
}
.footer .grid-4 {
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 28px;
}
.footer h4, .footer .footer__heading { color: var(--white); font-size: 1.05rem; margin-bottom: 16px; font-weight: 700; }
.footer a { color: var(--gray-300); transition: color .2s; }
.footer a:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.footer p { color: var(--gray-300); }
.footer a:hover { color: var(--orange-light); text-decoration: underline; }
.footer ul li { margin-bottom: 8px; font-size: .95rem; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: .85rem;
  color: var(--gray-300);
}
.site-credit { margin-top: 12px; font-size: .78rem; color: var(--gray-400); }
.site-credit .site-credit__link { display: inline-flex; align-items: center; gap: 8px; color: var(--gray-300); text-decoration: none; }
.site-credit .site-credit__link img { display: block; width: 26px; height: 26px; }
.site-credit .site-credit__link strong { color: var(--white); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.35); }
.site-credit .site-credit__link:hover strong { text-decoration-color: currentColor; }

/* ---- Sticky Mobile CTA ---- */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  color: var(--white);
  text-align: center;
  padding: 0;
  font-weight: 700;
  z-index: 999;
  box-shadow: 0 -4px 12px rgba(0,0,0,.15);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .hero { padding: 60px 0 70px; }
  .hero h1 { font-size: 2.1rem; }
  .lead-form { max-width: 100%; margin-top: 30px; }
  .site-logo { height: 72px; max-height: 72px; }
  .hero-logo { height: 90px; }
}

@media (max-width: 768px) {
  .header__nav { display: none; }
  .header__nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--white);
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
  }
  .header__hamburger { display: flex; }
  .mobile-cta { display: block; }
  body { padding-bottom: 56px; }
  .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .trust-bar__inner { gap: 20px; }
  .site-logo { height: 60px; max-height: 60px; }
  .hero-logo { height: 72px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1.05rem; }
  .lead-form { padding: 24px; }
}

/* ── Form Feedback States ── */

.form-success {
  text-align: center;
  padding: 30px 20px;
}
.form-success__icon {
  width: 60px;
  height: 60px;
  background: #16a34a;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}
.form-success h3 {
  margin-bottom: 8px;
  color: #1a1a1a;
}
.form-success p {
  color: #555;
  font-size: 0.95rem;
}
.form-success__phone {
  margin-top: 16px;
  font-weight: 600;
}
.form-success__phone a {
  color: #ea580c;
  text-decoration: none;
}
.form-success__phone a:hover {
  text-decoration: underline;
}

.form-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.form-submitting button[type="submit"] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ---- Force light-mode form inputs (dark mode fix) ---- */
/* Prevents OS dark mode from making form fields unreadable */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
  border: 1.5px solid #9ca3af !important;
  -webkit-text-fill-color: #1a1a1a !important;
  color-scheme: light !important;
}

input::placeholder,
textarea::placeholder {
  color: #374151 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
  -webkit-text-fill-color: #374151 !important;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  color: #374151 !important;
  font-weight: 500 !important;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #374151 !important;
  font-weight: 500 !important;
}

input:-moz-placeholder,
textarea:-moz-placeholder {
  color: #374151 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

@media (prefers-color-scheme: dark) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  select,
  textarea {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
  }

  input::placeholder,
  textarea::placeholder {
    color: #374151 !important;
    font-weight: 500 !important;
    -webkit-text-fill-color: #374151 !important;
  }
}


/* ---- Inline Lead Capture Section (site-wide conversion block) ---- */
.inline-lead {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 60px 0;
}
.inline-lead .grid-2 { align-items: center; gap: 48px; }
.inline-lead h2 { color: var(--white); margin-bottom: 14px; }
.inline-lead p { color: rgba(255,255,255,.9); }
.inline-lead .checklist li { color: rgba(255,255,255,.92); }
.inline-lead .checklist li::before { color: var(--orange-light); }
.inline-lead .lead-form { max-width: 460px; margin-left: auto; }
.inline-lead__phone {
  display: inline-block;
  margin-top: 22px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  border-bottom: 2px solid var(--orange-light);
  padding-bottom: 2px;
}
.inline-lead__phone:hover { color: var(--orange-light); }

/* ---- Service Areas hub ---- */
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.area-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; padding: 22px 24px; box-shadow: var(--shadow); }
.area-card h3 { margin-bottom: 10px; font-size: 1.15rem; }
.area-card ul { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.area-card ul li a { font-size: .93rem; font-weight: 600; color: var(--orange-text); }
.area-card ul li a:hover { text-decoration: underline; }
.area-card .area-card__note { font-size: .88rem; color: var(--gray-600); margin-top: 12px; }

/* ---- Sticky Mobile CTA (dual action) ---- */
.mobile-cta__inner { display: flex; }
.mobile-cta a {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 8px;
  font-weight: 700; font-size: 1rem; color: var(--white);
}
.mobile-cta a.mobile-cta__call { background: var(--navy); }
.mobile-cta a.mobile-cta__form { background: var(--orange-dark); }

@media (max-width: 1080px) {
  .header__nav { gap: 15px; }
  .header__nav a { font-size: .88rem; }
  .header__cta { padding: 9px 16px; font-size: .88rem; }
}
@media (max-width: 900px) {
  .footer .grid-4 { grid-template-columns: 1fr 1fr; }
  .inline-lead .grid-2 { grid-template-columns: 1fr; }
  .inline-lead .lead-form { margin-left: 0; max-width: 100%; }
}
@media (max-width: 768px) {
  .footer .grid-4 { grid-template-columns: 1fr; }
}
