/* ==========================================================================
   Renavize App Design System
   A cohesive, premium, mobile-first foundation for the site.
   ========================================================================== */

:root {
  --brand: #0F172A;
  --primary: #1E3A8A;
  --primary-soft: #EFF6FF;
  --primary-dark: #1E40AF;
  --accent: #EA580C;
  --accent-dark: #B45309;
  --accent-soft: #FFFBEB;
  --teal: #0F766E;
  --teal-soft: #F0FDFA;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text: #0F172A;
  --text-muted: #475569;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --success: #16A34A;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 4px 12px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  border: 1px solid transparent;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(234, 88, 12, .35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(234, 88, 12, .4); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); background: var(--bg); }

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  color: var(--brand);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ---------- Sections ---------- */
.section {
  padding: 48px 0;
}
.section-label {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ---------- Lead capture ---------- */
.lead-capture {
  padding: 40px 0 56px;
  background: linear-gradient(180deg, #FFF7ED 0%, #F8FAFC 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lead-capture-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: 10px;
}
.lead-capture-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}
#leadWizard {
  width: 100%;
}

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -0.04em;
}

/* ---------- Hero ---------- */
.hero {
  padding: 48px 0 56px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  margin-bottom: 14px;
}
.hero .subhead {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 24px;
}
.hero-search {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-search .search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-search input {
  flex: 1 1 220px;
  min-width: 160px;
  padding: 15px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  background: #fff;
}
.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, .12);
}
.hero-search .btn-primary { padding: 15px 22px; }

/* ---------- Cards / Grid ---------- */
.grid {
  display: grid;
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- Directory ---------- */
.directory {
  padding: 32px 0 56px;
}
.directory-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.directory-header h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 6px; }
.directory-controls { display: flex; align-items: center; gap: 12px; }

.filter-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-stack .filter-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .92rem;
  background: #fff;
  color: var(--text);
}
.contractor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.contractor-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.contractor-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.contractor-card .card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.contractor-card h3 { font-size: 1.05rem; }
.contractor-card .card-meta { font-size: .92rem; color: var(--text-muted); }
.contractor-card .card-footer {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.contractor-card .card-badge {
  font-size: .75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
}
.contractor-card .card-badge.emergency { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }

/* ---------- Profile ---------- */
.profile {
  padding: 32px 0 80px;
}
.profile-header {
  background: linear-gradient(180deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 32px 0;
  text-align: center;
}
.profile-header .badge {
  display: inline-block;
  font-size: .8rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  margin-bottom: 14px;
}
.profile-header h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); color: #fff; }
.profile-header .tagline { color: #E2E8F0; font-size: 1.05rem; }
.profile-body {
  max-width: 820px;
  margin: 0 auto;
}
.profile-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.profile-section h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.service-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-2);
}
.service-card h3 { margin-bottom: 4px; }
.service-card .price { color: var(--accent); font-weight: 700; }

/* ---------- CTA ---------- */
.cta {
  background: var(--brand);
  color: #fff;
  padding: 48px 0;
  border-radius: 16px;
  margin: 24px 0;
}
.cta-block h2 {
  font-size: 1.35rem;
  margin-bottom: 6px;
}
.cta-block p { color: #CBD5E1; font-size: .95rem; margin-bottom: 14px; }
.cta .btn-outline { color: #fff; border-color: rgba(255,255,255,.35); }
.cta .btn-outline:hover { background: rgba(255,255,255,.1); }
.cta .btn-outline + .btn-outline { margin-left: 10px; }
.site-footer {
  background: var(--brand);
  color: #CBD5E1;
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.footer-brand p { color: #94A3B8; }
.footer-links h4 {
  color: #fff;
  margin-bottom: 10px;
  font-size: 1.05rem;
}
.footer-links ul { list-style: none; }
.footer-links a { color: #CBD5E1; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.15);
  color: #64748B;
  font-size: .9rem;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .hero-search .search-row { flex-direction: column; }
  .hero-search input { width: 100%; }
  .hero-search .btn-primary { width: 100%; }
  .filter-stack { flex-direction: column; }
  .directory-header { flex-direction: column; align-items: stretch; }
  .directory-header .btn { width: 100%; }
}

/* ---------- Hero (lead wizard) ---------- */
.hero { padding: 40px 0 56px; }
.hero-content { max-width: 760px; margin: 0 auto; text-align: center; }
#leadWizard { max-width: 560px; margin: 18px auto 0; width: 100%; }
.hero-visual { display: none; }
@media (min-width: 900px) { .hero-visual { display: block; } }

/* ==========================================================================
   Premium Redesign Layer (award-winning polish)
   ========================================================================== */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --brand: #0B1220;
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --accent: #F97316;
  --accent-dark: #EA580C;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-muted: #475569;
  --border: #E2E8F0;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 30px 70px rgba(15, 23, 42, .14);
  --radius: 18px;
  --radius-sm: 12px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37,99,235,.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(249,115,22,.08), transparent 60%),
    var(--bg);
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(200%) blur(18px);
  -webkit-backdrop-filter: saturate(200%) blur(18px);
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.logo { font-weight: 900; letter-spacing: -.05em; background: linear-gradient(135deg,#2563EB,#F97316); -webkit-background-clip:text; background-clip:text; color: transparent; }

.hero h1 { font-weight: 900; letter-spacing: -.04em; }
.hero .subhead { max-width: 62ch; margin-left:auto; margin-right:auto; }

.btn { border-radius: 14px; }
.btn-primary {
  background: linear-gradient(135deg, #F97316, #EA580C);
  box-shadow: 0 12px 28px rgba(249,115,22,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(249,115,22,.42); }

.card, .contractor-card, .category-card {
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover, .contractor-card:hover, .category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15,23,42,.12);
}

.trust-grid, .categories-grid, .contractor-grid {
  gap: 18px;
}

/* ==========================================================================
   Accessibility & UX States Layer
   ========================================================================== */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: #fff; padding: 10px 16px;
  z-index: 1000; border-radius: 0 0 8px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.empty-state, .error-state {
  text-align: center; padding: 48px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border); color: var(--text-muted);
}
.empty-state h3, .error-state h3 { color: var(--brand); margin-bottom: 8px; }
.error-state { border-color: #FECACA; background: #FEF2F2; color: #991B1B; }
.loading-state { text-align: center; padding: 32px; color: var(--text-muted); }
.loading-state::after {
  content: ''; display: inline-block; width: 24px; height: 24px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin-left: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 32px 0; }
}
