/* ============================================================
   Century Plumbing — Brand layer over Bootstrap 5
   Design tokens preserved from the Century Plumbing Design System.
   WCAG 2.1 AA: contrast-safe gold-on-light, visible focus,
   reduced-motion support.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Barlow+Semi+Condensed:wght@500;600;700&display=swap');

:root {
  /* Brand palette */
  --navy-900: #021f3a;
  --navy-800: #022c52;
  --navy-700: #034078;
  --navy-600: #0a4f8f;
  --navy-500: #1d63a6;
  --navy-400: #5286b8;
  --navy-200: #b3cbe2;
  --navy-100: #dceaf6;
  --navy-50:  #eef5fb;

  --gold-700: #8f7635;
  --gold-600: #a98e48;
  --gold-500: #bfa45e;
  --gold-400: #cfb87e;
  --gold-300: #ddcda0;
  --gold-100: #f1e9d4;
  --gold-50:  #f9f5ea;
  /* Accessible gold for SMALL text on light backgrounds (>=5:1 on white) */
  --gold-ink: #806a2e;

  --copper-500: #a85a36;

  --black:    #111417;
  --ink-900:  #1a1f25;
  --ink-700:  #3a424b;
  --ink-500:  #5d6772;
  --ink-400:  #828d99;
  --ink-300:  #aab2bc;
  --line-200: #d7dce1;
  --line-100: #e8ebef;
  --paper-100:#f4f6f8;
  --paper-50: #fafbfc;
  --white:    #ffffff;

  --success-600: #1f7a4d;
  --success-100: #dcefe4;
  --danger-600:  #b3331f;
  --danger-100:  #f7dcd7;

  /* Semantic aliases */
  --color-primary: var(--navy-700);
  --color-accent: var(--gold-500);
  --text-strong: var(--ink-900);
  --text-body: var(--ink-700);
  --text-muted: var(--ink-500);
  --surface-page: var(--paper-50);
  --surface-card: var(--white);
  --surface-sunken: var(--paper-100);
  --border-default: var(--line-200);
  --border-subtle: var(--line-100);
  --border-strong: var(--ink-300);

  /* Type */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-heading: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, sans-serif;

  /* Radii / shadows */
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-sm: 0 1px 3px rgba(2,31,58,0.08), 0 1px 2px rgba(2,31,58,0.06);
  --shadow-md: 0 4px 10px rgba(2,31,58,0.08), 0 2px 4px rgba(2,31,58,0.05);
  --shadow-lg: 0 12px 28px rgba(2,31,58,0.12), 0 4px 8px rgba(2,31,58,0.06);

  /* Bootstrap variable overrides */
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink-700);
  --bs-body-bg: var(--paper-50);
  --bs-primary: #034078;
  --bs-primary-rgb: 3, 64, 120;
  --bs-link-color: #034078;
  --bs-link-color-rgb: 3, 64, 120;
  --bs-link-hover-color: #022c52;
  --bs-border-color: var(--line-200);
}

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--surface-page);
}

/* ---- Headings ---- */
h1, h2, h3, h4, .font-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-strong);
}
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 0 0.625rem;
}
.eyebrow-gold { color: var(--gold-ink); }       /* small gold text on light = AA safe */
.eyebrow-gold-on-dark { color: var(--gold-400); }
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ---- Skip link (WCAG 2.4.1) ---- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1100;
  background: var(--navy-900);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: top 150ms ease;
}
.skip-link:focus { top: 12px; }

/* ---- Visible focus for all interactive elements (WCAG 2.4.7) ---- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.nav-link:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
  box-shadow: none;
}
/* On dark surfaces, keep the gold ring but add a white halo for separation */
.on-dark a:focus-visible,
.on-dark .btn:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 3px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(191,164,94,0.45);
}

/* ---- Utility bar ---- */
.utility-bar { background: var(--navy-900); color: var(--gold-400); font-size: 13px; }
.utility-bar a { color: #fff; text-decoration: none; }
.utility-bar a:hover { text-decoration: underline; }
.utility-label {
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
}

/* ---- Header / navbar ---- */
.site-header {
  position: sticky; top: 0; z-index: 1020;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .nav-link {
  font-size: 14px; font-weight: 600;
  color: var(--text-body);
  padding: 0.5rem 0;
}
.site-header .nav-link:hover { color: var(--navy-700); }
.site-header .nav-link[aria-current="page"] { color: var(--navy-700); }
.header-phone {
  font-family: var(--font-heading);
  font-weight: 700; font-size: 18px;
  color: var(--navy-700); text-decoration: none;
}
.header-phone:hover { color: var(--navy-800); text-decoration: underline; }
.logo-img { width: 50px; height: 50px; object-fit: contain; }

/* ---- Buttons ---- */
.btn { font-family: var(--font-body); font-weight: 600; border-radius: var(--radius-md); }
.btn-accent {
  background: var(--gold-500);
  border: 1px solid var(--gold-500);
  color: var(--navy-900);             /* 6.8:1 on gold — AA */
}
.btn-accent:hover, .btn-accent:focus {
  background: var(--gold-600);
  border-color: var(--gold-600);
  color: var(--navy-900);
}
.btn-brand-primary {
  background: var(--navy-700);
  border: 1px solid var(--navy-700);
  color: #fff;
}
.btn-brand-primary:hover, .btn-brand-primary:focus {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.btn-outline-brand {
  background: transparent;
  border: 1.5px solid var(--navy-700);
  color: var(--navy-700);
}
.btn-outline-brand:hover, .btn-outline-brand:focus {
  background: var(--navy-50);
  color: var(--navy-800);
}
.btn-outline-on-dark {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.7);
  color: #fff;
}
.btn-outline-on-dark:hover, .btn-outline-on-dark:focus {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: #fff;
}
.btn-outline-navy-solid {
  background: transparent;
  border: 1.5px solid var(--navy-900);
  color: var(--navy-900);
}
.btn-outline-navy-solid:hover, .btn-outline-navy-solid:focus {
  background: rgba(2,31,58,0.08);
  color: var(--navy-900);
}

/* ---- Surfaces ---- */
.bg-navy-900 { background: var(--navy-900); }
.bg-navy-700 { background: var(--navy-700); }
.bg-sunken { background: var(--surface-sunken); }
.bg-gold-500 { background: var(--gold-500); }
.text-navy-700 { color: var(--navy-700); }
.text-gold-on-dark { color: var(--gold-400); }
.on-dark, .on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: #fff; }
.on-dark .text-soft { color: var(--navy-100); }
.on-dark .text-softer { color: var(--navy-200); }

/* ---- Cards ---- */
.brand-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.brand-card--featured { border-top: 3px solid var(--gold-500); }
.icon-badge {
  width: 48px; height: 48px; border-radius: 6px;
  background: var(--navy-50); color: var(--navy-700);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.icon-badge--gold { background: var(--gold-50); color: var(--gold-ink); }
.service-link {
  color: var(--navy-700); font-weight: 700; font-size: 14px; text-decoration: none;
}
.service-link:hover { color: var(--navy-800); text-decoration: underline; }
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li { display: flex; gap: 10px; font-size: 14px; color: var(--text-body); margin-bottom: 8px; }
.feature-list .diamond { color: var(--gold-ink); flex: none; }
.price-tag { font-family: var(--font-heading); font-weight: 700; color: var(--navy-700); font-size: 17px; }

/* ---- Town chips ---- */
.town-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 8px; padding: 12px 14px;
  font-weight: 600; color: var(--text-strong); font-size: 14px;
}
.town-chip svg { color: var(--gold-ink); flex: none; }
.town-chip--more {
  background: var(--navy-50); border-color: var(--navy-100);
  color: var(--navy-700); font-weight: 700;
}

/* ---- Section eyebrow rhythm ---- */
.section-pad { padding: 96px 0; }
.section-pad-sm { padding: 72px 0; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; background: var(--navy-900); }
.hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 60% center; opacity: 0.4;
}
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(2,31,58,0.94) 0%, rgba(2,31,58,0.78) 48%, rgba(2,31,58,0.4) 100%);
}
.hero__inner { position: relative; padding: 104px 0 96px; }
.hero h1 { color: #fff; font-size: clamp(2.75rem, 5vw, 4.5rem); line-height: 1.02; letter-spacing: -0.01em; }

/* ---- Stats ---- */
.stat-value { font-family: var(--font-heading); font-weight: 700; font-size: 2.25rem; line-height: 1; color: var(--gold-400); }
.stat-label { font-size: 14px; color: var(--navy-100); }

/* ---- Map ---- */
.map-frame {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border-default); box-shadow: var(--shadow-lg);
  min-height: 520px;
}
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-badge {
  position: absolute; top: 16px; left: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(2,31,58,0.92); color: #fff;
  padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-md);
}
.map-rule { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--gold-500); }

/* ---- Steps ---- */
.step-num {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--navy-700); color: #fff;
  font-family: var(--font-heading); font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.step-num--gold { background: var(--gold-500); color: var(--navy-900); }

/* ---- Forms ---- */
.form-label { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.form-control, .form-select {
  font-family: var(--font-body); font-size: 16px; color: var(--text-strong);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
}
.form-control { min-height: 46px; }
.req { color: var(--danger-600); }
.field-error { font-size: 12px; color: var(--danger-600); margin-top: 4px; }
.was-validated .form-control:invalid, .form-control.is-invalid,
.was-validated .form-select:invalid, .form-select.is-invalid {
  border-color: var(--danger-600);
}
.alert-emergency {
  background: var(--gold-50); border: 1px solid var(--gold-300);
  border-radius: 8px; color: var(--gold-700); font-size: 14px;
}
.alert-emergency a { color: var(--navy-700); font-weight: 700; }
.success-panel {
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-top: 3px solid var(--success-600); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--success-100); color: var(--success-600);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}

/* ---- Footer ---- */
.site-footer { background: var(--navy-900); color: var(--navy-100); }
.site-footer h2.footer-head, .site-footer h3.footer-head {
  font-family: var(--font-heading); font-size: 15px; letter-spacing: 0.04em;
  text-transform: uppercase; color: #fff; margin-bottom: 16px;
}
.site-footer a { color: var(--navy-200); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .footer-phone { color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 20px; }
.footer-logo-ring {
  width: 54px; height: 54px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); padding: 3px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}

/* ---- Breadcrumb ---- */
.brand-breadcrumb { font-size: 13px; color: var(--navy-100); }
.brand-breadcrumb a { color: var(--navy-100); }
.brand-breadcrumb .current { color: var(--gold-400); font-weight: 600; }

/* ---- Reduced motion (WCAG 2.3.3 / 2.2.2) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Section header helper ---- */
.section-head { max-width: 660px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: 2.5rem; line-height: 1.05; }
.lead-muted { color: var(--text-muted); font-size: 17px; }
