/* =============================================
   Utah Senior Care Finder — Main Stylesheet
   ============================================= */

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

:root {
  --sage:       #5C7A6A;
  --sage-light: #EAF0EC;
  --stone:      #2E2E2E;
  --warm-white: #FAF8F5;
  --muted:      #6B6B6B;
  --border:     #DDD8D0;
  --accent:     #B5622E;
  --sky:        #3B7EC8;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--stone);
  background: var(--warm-white);
  line-height: 1.6;
}

h1, h2, h3 { font-family: 'Lora', serif; line-height: 1.25; }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.content-narrow { max-width: 720px; }

/* ── HEADER ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sage);
  text-decoration: none;
}
.site-header nav { display: flex; gap: 28px; }
.site-header nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.site-header nav a:hover,
.site-header nav a.active { color: var(--sage); }

/* ── HERO ── */
.hero {
  background: var(--sage);
  color: #fff;
  padding: 56px 0 48px;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 8px;
  color: #fff;
}
.hero-sub { font-size: 1rem; opacity: 0.85; margin-bottom: 28px; }

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 860px;
}
.search-bar input,
.search-bar select {
  flex: 1 1 200px;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--stone);
}
.search-bar button {
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.search-bar button:hover { background: #9e5227; }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  background: var(--sage-light);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 36px;
}
.page-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 8px; }
.page-hero p { color: var(--muted); }

/* ── MAP SECTION ── */
.map-section { padding: 0; }
.map-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  height: calc(100vh - 60px);
  max-height: 700px;
}
#map { height: 100%; min-height: 400px; z-index: 1; }

.results-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}
.results-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.facility-list { overflow-y: auto; flex: 1; }
.facility-card {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.facility-card:hover { background: var(--sage-light); }
.facility-card.active { background: var(--sage-light); border-left: 3px solid var(--sage); }
.facility-card h3 { font-size: 0.95rem; font-family: 'Inter', sans-serif; font-weight: 600; margin-bottom: 4px; }
.facility-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.care-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--sage-light);
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── PAID-TIER MEDIA (photos & video) ── */
.facility-gallery {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 10px;
  border-radius: 6px;
}
.facility-photo {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--sage-light);
  cursor: pointer;
  transition: opacity 0.12s;
}
.facility-photo:hover { opacity: 0.85; }

/* ── LIGHTBOX ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
}
.facility-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin-bottom: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}
.facility-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.facility-card .btn-inquire {
  font-size: 0.8rem;
  padding: 6px 14px;
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.facility-card .btn-inquire:hover { background: #4a6457; }

/* ── MODAL ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 36px;
  width: 100%;
  max-width: 520px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  font-size: 1.5rem; cursor: pointer;
  color: var(--muted);
}
.modal-box h2 { margin-bottom: 4px; font-size: 1.3rem; }
.modal-facility-name { color: var(--sage); font-weight: 600; margin-bottom: 20px; }

/* ── FORMS ── */
form label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  gap: 5px;
  margin-bottom: 14px;
}
form input,
form select,
form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--stone);
  background: #fff;
  transition: border-color 0.15s;
}
form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--sage);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-primary:hover { background: #4a6457; text-decoration: none; }
.btn-outline {
  display: inline-block;
  padding: 12px 28px;
  background: transparent;
  color: var(--sage);
  border: 2px solid var(--sage);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-outline:hover { background: var(--sage-light); text-decoration: none; }
.form-success {
  margin-top: 16px;
  padding: 14px 18px;
  background: #e8f5e9;
  border-radius: var(--radius);
  color: #2e7d32;
  font-weight: 500;
}
.form-success.hidden { display: none; }

/* ── CONTENT SECTIONS ── */
.content-section { padding: 60px 0; }
.content-section h2 { margin-bottom: 16px; font-size: 1.5rem; }
.content-section p { color: var(--muted); margin-bottom: 16px; }
.section-title { text-align: center; margin-bottom: 40px; font-size: 1.8rem; }

/* ── STEPS ── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 32px 0 48px; }
.step { padding: 24px; background: var(--sage-light); border-radius: var(--radius); }
.step-label { display: inline-block; font-weight: 700; color: var(--sage); margin-bottom: 10px; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; }
.step p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ── TIERS ── */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 64px; }
.tier {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  position: relative;
  background: #fff;
}
.tier.featured {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px var(--sage);
}
.tier-badge {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: var(--sage);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.tier-name { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.tier-price { font-family: 'Lora', serif; font-size: 2rem; font-weight: 600; margin-bottom: 20px; color: var(--sage); }
.tier-price span { font-size: 1rem; color: var(--muted); }
.tier ul { list-style: none; margin-bottom: 28px; }
.tier ul li { font-size: 0.88rem; color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--border); }
.tier ul li::before { content: "✓ "; color: var(--sage); font-weight: 700; }

/* ── CLAIM FORM ── */
.claim-section { max-width: 700px; }
.claim-section h2 { margin-bottom: 8px; }
.claim-section > p { color: var(--muted); margin-bottom: 28px; }

/* ── DASHBOARD ── */
.dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  align-items: center;
}
.dash-filters select,
.dash-filters input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
}
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.stat-num { font-family: 'Lora', serif; font-size: 2.2rem; font-weight: 600; color: var(--sage); }
.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.leads-table th {
  background: var(--sage-light);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.leads-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--stone); }
.leads-table tr:last-child td { border-bottom: none; }
.empty-row { text-align: center; color: var(--muted); padding: 32px; }
.dash-note { margin-top: 20px; font-size: 0.82rem; color: var(--muted); }
.dash-note code { background: var(--sage-light); padding: 1px 5px; border-radius: 3px; }

/* ── FOOTER ── */
.site-footer {
  background: var(--stone);
  color: rgba(255,255,255,0.6);
  padding: 28px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}
.site-footer nav { display: flex; gap: 20px; }
.site-footer nav a { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.site-footer nav a:hover { color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; max-height: none; }
  #map { height: 350px; }
  .results-panel { max-height: 400px; }
  .tiers { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-inner nav { gap: 14px; }
  .site-header nav a { font-size: 0.82rem; }
  .dash-stats { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
