/* =========================================================
   crawlspacecostcalculator.com — Shared Stylesheet
   Colors: #1B4965 (primary) | #5FA8D3 (accent) | #F77F00 (CTA)
           #F8F9FA (bg) | #212529 (text) | #2D6A4F (success)
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #1B4965;
  --accent:    #5FA8D3;
  --cta:       #F77F00;
  --cta-hover: #d96e00;
  --bg:        #F8F9FA;
  --surface:   #ffffff;
  --text:      #212529;
  --muted:     #6c757d;
  --border:    #dee2e6;
  --success:   #2D6A4F;
  --success-bg:#d4edda;
  --error:     #dc3545;
  --radius:    6px;
  --shadow:    0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  color: var(--primary);
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); margin: 2.5rem 0 1rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); margin: 1.75rem 0 .75rem; }
p  { margin-bottom: 1rem; }
a  { color: var(--primary); text-decoration: underline; }
a:hover { color: var(--accent); }
ul, ol { margin: 0 0 1rem 1.5rem; }
li { margin-bottom: .35rem; }
strong { font-weight: 600; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container--narrow { max-width: 720px; }

/* ── Site Header ── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: .9rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.01em;
}
.site-logo span { color: var(--cta); }
.site-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-nav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}
.site-nav a:hover { color: #fff; }

/* ── Hero / Page Header ── */
.page-hero {
  background: var(--primary);
  color: #fff;
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.page-hero h1 { color: #fff; margin-bottom: .5rem; }
.page-hero .subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Calculator Card ── */
.calculator-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin: 2rem auto;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 640px) { .calc-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-weight: 600;
  font-size: .9rem;
  color: var(--primary);
}
label .req { color: var(--error); margin-left: 2px; }

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95,168,211,.2);
}
input.error { border-color: var(--error); }
.field-error { color: var(--error); font-size: .82rem; display: none; }
.field-error.visible { display: block; }

/* Radio / Checkbox groups */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
}
.radio-group label, .checkbox-group label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 400;
  font-size: .95rem;
  cursor: pointer;
  color: var(--text);
}
.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Calculate Button */
.btn-calculate {
  width: 100%;
  padding: .9rem 1.5rem;
  background: var(--cta);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  margin-top: .5rem;
  letter-spacing: .01em;
}
.btn-calculate:hover { background: var(--cta-hover); }
.btn-calculate:active { transform: scale(.99); }

/* ── Result Box ── */
.result-box {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  text-align: center;
  margin: 1.5rem 0 1rem;
}
.result-box .result-label { font-size: .9rem; opacity: .85; margin-bottom: .25rem; }
.result-box .result-range {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -.02em;
}
.result-box .result-sub { font-size: .9rem; opacity: .8; margin-top: .4rem; }

/* Itemized breakdown */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  margin: 1rem 0;
}
.breakdown-table td { padding: .45rem .25rem; }
.breakdown-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.breakdown-table .divider td { border-top: 2px solid var(--border); }
.breakdown-table .subtotal td { font-weight: 600; }
.breakdown-table .total-row td { font-weight: 700; color: var(--primary); }

/* ── CTA Boxes ── */
.cta-box {
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}
.cta-box--il {
  background: var(--success-bg);
  border: 2px solid var(--success);
}
.cta-box--il .cta-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--success);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .5rem;
}
.cta-box--il .cta-phone {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cta);
  text-decoration: none;
  display: block;
  margin: .4rem 0;
}
.cta-box--other {
  background: #e8f4f8;
  border: 2px solid var(--accent);
}
.cta-box--other .cta-headline {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .5rem;
}

/* Sticky call button (IL users on result) */
.sticky-call-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--cta);
  color: #fff;
  text-align: center;
  padding: .9rem 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  z-index: 200;
  text-decoration: none;
}
.sticky-call-bar.visible { display: block; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .15s;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: #153d54; color: #fff; }
.btn--cta { background: var(--cta); color: #fff; }
.btn--cta:hover { background: var(--cta-hover); color: #fff; }
.btn--outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn--outline:hover { background: var(--primary); color: #fff; }

/* ── Content Pages ── */
.content-section { padding: 3rem 0; }
.content-section:nth-child(even) { background: var(--surface); }

.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { border-bottom: 2px solid var(--border); padding-bottom: .4rem; }

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  display: block;
}
.data-table th {
  background: var(--primary);
  color: #fff;
  padding: .6rem .85rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tr:nth-child(even) td { background: #f3f7fa; }
.data-table tr:hover td { background: #e8f4f8; }
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Info Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}
.card h3 { margin-top: 0; font-size: 1rem; }
.card p { font-size: .9rem; margin-bottom: 0; }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: .4rem;
}
.faq-a { font-size: .95rem; color: var(--text); margin: 0; }

/* ── Step list ── */
.step-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.step-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}
.step-content h3 { margin-top: 0; font-size: 1rem; }
.step-content p { margin: 0; font-size: .93rem; }

/* ── Notice / callout ── */
.notice {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: .85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .93rem;
  margin: 1rem 0;
}
.notice--info {
  background: #e8f4f8;
  border-left-color: var(--accent);
}
.notice--success {
  background: var(--success-bg);
  border-left-color: var(--success);
}

/* ── State pages ── */
.state-hero {
  background: linear-gradient(135deg, var(--primary) 60%, #24618a);
  color: #fff;
  padding: 2.5rem 0;
}
.state-hero h1 { color: #fff; }
.state-hero .cost-snapshot {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.cost-snapshot-item .label {
  font-size: .8rem;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cost-snapshot-item .value {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* States index grid */
.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}
.states-grid a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: .93rem;
  transition: border-color .15s, box-shadow .15s;
}
.states-grid a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  color: var(--primary);
}

/* ── Forms (contact / waitlist) ── */
.form-stack { display: flex; flex-direction: column; gap: 1rem; max-width: 560px; }
.form-stack textarea { resize: vertical; min-height: 120px; }
.form-success {
  background: var(--success-bg);
  border: 1px solid var(--success);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--success);
  font-weight: 600;
  display: none;
}

/* ── Footer ── */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.75);
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.footer-grid a { color: rgba(255,255,255,.7); text-decoration: none; display: block; margin-bottom: .35rem; font-size: .88rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1.25rem;
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ── Utilities ── */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .calculator-section { padding: 1.25rem; }
  .result-box { padding: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  h2 { margin-top: 2rem; }
}
