/* =====================================================================
   MARICOPA PEST CONTROL - shared design system
   Base: Houston Valet Trash palette, type and spacing. Mobile first.
   ===================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  --navy: #0B1F3A;
  --navy-dark: #071428;
  --navy-mid: #122847;
  --green: #2ECC71;
  --green-dark: #27AE60;
  --green-light: #58D68D;
  --gray-light: #F4F6F9;
  --gray-mid: #D5DAE4;
  --gray-text: #6B7A99;
  --white: #FFFFFF;
  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --radius: 10px;
  --shadow: 0 8px 32px rgba(11,31,58,0.13);
  --transition: 0.3s ease;
  /* Accessible text variants (the base grey and greens fail 4.5:1 as small text on light backgrounds) */
  --text-muted: #4F5D7A;
  --green-text: #146C3A;
  --error: #9B1C1C;
}

/* ---------- 2. Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { font-family: var(--font-body); font-size: 16px; line-height: 1.7; color: var(--navy); background: var(--white); overflow-wrap: break-word; }
img, svg { max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-head); }
p + p { margin-top: 16px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
#site-header :focus-visible, #section-hero :focus-visible, .bg-navy :focus-visible, #section-estimate :focus-visible, #site-footer :focus-visible { outline-color: var(--green); }
#estimate-form-wrap :focus-visible { outline-color: var(--navy); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--green); color: var(--navy); padding: 10px 16px; border-radius: var(--radius); font-weight: 600; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 3. Utilities ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section-pad { padding: 56px 0; }
.section-pad-sm { padding: 48px 0; }
.text-center { text-align: center; }
.text-center .section-subtitle { margin-left: auto; margin-right: auto; }
.bg-gray { background: var(--gray-light); }
.bg-navy { background: var(--navy); color: var(--white); }
.tag { display: inline-block; background: rgba(46,204,113,0.12); color: var(--green-text); font-family: var(--font-head); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 14px; border-radius: 50px; margin-bottom: 14px; }
.bg-navy .tag, #section-hero .tag, #section-estimate .tag { color: var(--green-light); }
.divider { width: 56px; height: 4px; border-radius: 4px; background: var(--green); margin: 0 0 24px; }
.divider-center { margin: 0 auto 24px; }
.section-title { font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; margin-bottom: 18px; }
.section-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 640px; margin-bottom: 40px; }
.bg-navy .section-subtitle { color: var(--gray-mid); }

/* ---------- 4. Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 28px; border: 2px solid transparent; border-radius: var(--radius); font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; text-decoration: none; text-align: center; cursor: pointer; transition: var(--transition); }
.btn-green { background: var(--green); color: var(--navy); }
.btn-green:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46,204,113,0.35); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-dark); transform: translateY(-2px); }
.btn-outline { border-color: var(--white); color: var(--white); background: transparent; }
.btn-outline:hover { background: var(--white); color: var(--navy); }
.btn[disabled] { opacity: 0.7; cursor: wait; }

/* ---------- 5. Header and navigation ---------- */
#site-header { position: sticky; top: 0; z-index: 1000; background: var(--navy-dark); box-shadow: 0 2px 20px rgba(0,0,0,0.25); }
#navbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 72px; }
#nav-logo { display: flex; align-items: center; }
#nav-logo img { height: 52px; width: auto; max-width: 100%; }
#nav-toggle { display: none; width: 48px; height: 48px; background: none; border: 0; color: var(--white); font-size: 1.5rem; cursor: pointer; }
.js #nav-toggle { display: block; }
#nav-menu { display: flex; flex-direction: column; width: 100%; gap: 4px; padding: 12px 0 20px; }
.js #nav-menu { display: none; }
.js #nav-menu.open { display: flex; max-height: calc(100vh - 72px); overflow-y: auto; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 6px; background: none; font-family: var(--font-head); font-weight: 600; font-size: 0.88rem; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: var(--gray-mid); cursor: pointer; gap: 6px; }
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.nav-dropdown-menu { background: var(--navy); border-radius: var(--radius); overflow: hidden; }
.js .nav-dropdown-menu { display: none; }
.js .nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 12px 18px; font-family: var(--font-head); font-size: 0.85rem; font-weight: 600; text-decoration: none; color: var(--gray-mid); border-bottom: 1px solid rgba(255,255,255,0.08); }
.nav-dropdown-menu a:hover { background: rgba(46,204,113,0.10); color: var(--green); }
.nav-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; border-radius: var(--radius); background: var(--green); color: var(--navy); font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; text-decoration: none; }
.nav-cta:hover { background: var(--green-dark); }
@media (min-width: 901px) {
  .js #nav-toggle { display: none; }
  #nav-menu, .js #nav-menu, .js #nav-menu.open { display: flex; flex-direction: row; align-items: center; width: auto; padding: 0; gap: 2px; max-height: none; overflow: visible; }
  .nav-link { padding: 8px 9px; }
  .nav-cta { margin-left: 8px; padding: 10px 16px; }
  .nav-dropdown { position: relative; }
  .nav-dropdown-menu, .js .nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; box-shadow: var(--shadow); }
  .nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu, .js .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown.closed .nav-dropdown-menu { display: none !important; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  #nav-logo img { height: 38px; }
  #navbar { flex-wrap: nowrap; }
  .nav-link { padding: 8px 5px; font-size: 0.74rem; letter-spacing: 0; }
  .nav-cta { margin-left: 4px; padding: 8px 8px; font-size: 0.72rem; }
}

/* ---------- 6. Forms ---------- */
.form-card { background: var(--white); color: var(--navy); border-radius: 16px; padding: 28px 22px; box-shadow: var(--shadow); }
.form-title { font-weight: 800; font-size: 1.3rem; line-height: 1.3; margin-bottom: 20px; }
.lead-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-family: var(--font-head); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.form-group input, .form-group select, .form-group textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 2px solid var(--gray-text); border-radius: 8px; background: var(--gray-light); color: var(--navy); font: 400 1rem var(--font-body); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { background: var(--white); border-color: var(--navy); }
.form-group textarea { min-height: 110px; resize: vertical; }
.form-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; line-height: 1.5; }
.form-check input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--navy); }
.hp-field { position: absolute; left: -9999px; }
.form-status { border-radius: 8px; padding: 12px 14px; font-weight: 600; font-size: 0.92rem; }
.form-status[hidden] { display: none; }
.form-status.success { background: rgba(46,204,113,0.12); color: var(--navy); border: 2px solid var(--green-dark); }
.form-status.error { background: #FDF0F0; color: var(--error); border: 2px solid var(--error); }

/* ---------- 7. Footer ---------- */
#site-footer { background: var(--navy-dark); color: var(--gray-mid); }
#footer-main { display: grid; gap: 28px; padding-top: 56px; padding-bottom: 36px; }
#footer-logo { height: 48px; width: auto; margin-bottom: 16px; }
#footer-main p, .footer-links a { font-size: 0.9rem; }
.footer-col h2 { font-weight: 700; font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--white); margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 4px; }
.footer-links a { display: inline-block; padding: 4px 0; text-decoration: none; }
.footer-links a:hover { color: var(--green); text-decoration: underline; }
#footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; padding-bottom: 24px; font-size: 0.82rem; text-align: center; }

/* ---------- 8. Back to top ---------- */
#back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--green); color: var(--navy); font-size: 1.1rem; cursor: pointer; box-shadow: 0 4px 16px rgba(46,204,113,0.35); opacity: 0; visibility: hidden; transition: var(--transition); }
#back-to-top.visible { opacity: 1; visibility: visible; }

/* ---------- 9. Wider screens ---------- */
@media (min-width: 600px) { #footer-main { grid-template-columns: 1fr 1fr; gap: 40px; } .form-card { padding: 40px 36px; } }
@media (min-width: 769px) { .section-pad { padding: 80px 0; } }
@media (min-width: 1025px) { #footer-main { grid-template-columns: 2fr 1fr 1fr 1fr; } }

/* ---------- 10. Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  .animate-up { animation: fadeUp 0.6s ease both; }
  .delay-1 { animation-delay: 0.1s; }
  .delay-2 { animation-delay: 0.22s; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
