:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #111111;
  --dim: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --navy: #0f2540;
  --navy-deep: #0a1a2e;
  --good: #16a34a;
  --bad: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

header {
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  flex-wrap: wrap;
}

.header-inner img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.nav-link {
  border: 0;
  background: none;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg); }
.nav-link.active { background: var(--accent); color: #fff; }

.header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.header-auth .small { white-space: nowrap; }

.header-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-sub {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Form-heavy views stay readable on wide screens. */
#provider-view, #manager-view, #sales-reps-view { max-width: 760px; }

/* ---- Website home ---- */
.hero {
  border-radius: 20px;
  padding: 56px 32px;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 55%, var(--accent-strong) 100%);
  color: #fff;
  text-align: center;
}
.hero-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #93c5fd;
}
.hero h1 {
  margin: 0 auto;
  max-width: 720px;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero h1 em { color: #93c5fd; }
.hero h1 strong { color: #ffffff; }

/* FCC as-of note + refresh button, kept only on the Internet Locator. */
.locator-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.locator-foot .small { margin: 0; }
.locator-foot .ghost { flex-shrink: 0; }
.hero-sub {
  margin: 16px auto 0;
  max-width: 620px;
  font-size: 18px;
  line-height: 1.55;
  color: #dbeafe;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.hero-cta .primary { width: auto; margin-top: 0; padding: 14px 24px; }
.hero-cta .ghost {
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  padding: 14px 24px;
  font-size: 16px;
}
.hero-cta .ghost:hover { border-color: #fff; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.home-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.home-card h3 { margin: 0 0 8px; font-size: 18px; }
.home-card p { margin: 0 0 16px; }
.home-card .ghost { width: auto; }

/* ---- Sub-navigation inside a view ---- */
.subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.subnav-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
}
.subnav-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- About Us ---- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.about-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  text-align: center;
}
.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
}
.about-photo--center { object-position: center; }
.about-card h3 { margin: 0; font-size: 20px; }
.about-role {
  margin: 4px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.about-card p { line-height: 1.6; }

/* ---- Team sign-in modal ---- */
/* The [hidden] rule must win over the flex display below, or the
   modal can never be dismissed (a failed sign-in looks like a
   wrong password when the modal simply will not close). */
.login-modal[hidden] { display: none; }
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  background: rgba(15, 37, 64, 0.55);
}
.login-modal .login-box {
  width: 100%;
  max-width: 420px;
  margin: 0;
  border-radius: 16px;
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

label { font-size: 14px; font-weight: 600; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.field { margin-top: 12px; }
.field label { display: block; margin-bottom: 6px; }

.hint { margin: 6px 0 0; font-size: 12px; color: var(--dim); }

.check-field { margin-top: 16px; }
.check-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }

.radio-row {
  display: flex;
  gap: 20px;
  margin-top: 2px;
}
.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.radio-row input { width: 18px; height: 18px; accent-color: var(--accent); }

textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  resize: vertical;
}
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

input[type="file"] {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
input[type="file"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

button.primary {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.4; cursor: default; }

button.ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  cursor: pointer;
}
button.ghost:disabled { opacity: 0.4; cursor: default; }

.suggest-wrap { position: relative; margin-top: 8px; }

.suggest-list {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 20;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.suggest-list button {
  display: block;
  width: 100%;
  border: 0;
  background: var(--surface);
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}
.suggest-list button.highlight { background: var(--bg); font-weight: 600; }

.card {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.muted { color: var(--dim); font-size: 14px; }
.small { font-size: 12px; color: var(--dim); }
.error-text { color: var(--bad); font-size: 14px; font-weight: 500; margin-top: 16px; }
.ok-text { color: var(--good); font-size: 14px; font-weight: 500; margin-top: 16px; }

.matched {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.result-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--good);
}
.result-head h2.none { color: var(--bad); }

.pill {
  border-radius: 999px;
  background: var(--good);
  color: #fff;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.tech-group { margin-top: 20px; }
.tech-group h3 { margin: 0; font-size: 14px; font-weight: 700; }

.provider-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.provider-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.provider-list li + li { border-top: 1px solid var(--border); }

.provider-name { font-weight: 600; }
.provider-speed { font-size: 14px; color: var(--dim); }

.confirm-link {
  flex-shrink: 0;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: none;
}

.map-box {
  margin-top: 16px;
  height: 208px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.map-fallback {
  display: flex;
  height: 160px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
  color: var(--dim);
}

.progress {
  margin-top: 12px;
  height: 6px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg);
}
.progress > div {
  height: 100%;
  width: 33%;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.recent-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.recent-list li + li { border-top: 1px solid var(--border); }
.recent-list button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
}
.recent-list .addr { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.recent-list .date { display: block; font-size: 12px; color: var(--dim); }

footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-box { max-width: 420px; margin: 40px auto 0; }
.login-box h1 { font-size: 20px; margin: 0 0 4px; }
.login-box .field { margin-top: 16px; }
.login-box .field label { display: block; margin-bottom: 6px; }

.topbar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0;
}
.linklike {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
  text-decoration: underline;
}

/* Coverage map tab */
.tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
}
.tab {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
}
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.map-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-top: 4px;
}
.map-label { font-size: 14px; font-weight: 600; }
.map-controls select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
.map-controls select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.map-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}
.map-toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.map-toggles input { width: 18px; height: 18px; accent-color: var(--accent); }

#apply-filters-btn { margin-top: 12px; }
#apply-filters-btn.pending-filters {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.coverage-map {
  margin-top: 12px;
  height: 62vh;
  min-height: 360px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  z-index: 0;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
  font-weight: 600;
}
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.tract-popup { font-size: 14px; line-height: 1.5; }
.tract-popup .popup-head { margin-top: 8px; font-weight: 700; }
.tract-popup .popup-overlap { margin-top: 8px; font-weight: 700; color: var(--accent-strong); }
.tract-popup .popup-new { margin-top: 8px; font-weight: 700; color: #be123c; }

.sig-canvas { width: 100%; height: 150px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; }
.sig-row { display: flex; gap: 12px; align-items: center; margin-top: 8px; }

/* Pay plan shown on the Onboard Manager / Onboard Sales Representative
   tabs when a provider (and tier) is picked. Signing the form agrees
   to the plan shown. */
.payplan { margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.payplan h3 { margin: 0; padding: 12px 14px; background: #26313d; color: #fff; font-size: 16px; }
.payplan table { width: 100%; border-collapse: collapse; font-size: 14px; }
.payplan th, .payplan td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--border); }
.payplan th { background: #eef2f7; font-size: 13px; }
.payplan tbody tr:nth-child(even) td { background: #f6f8fa; }
.payplan td.num { text-align: right; font-variant-numeric: tabular-nums; }
.payplan th.num { text-align: right; }
.payplan td.tier-pick { font-weight: 700; color: var(--accent-strong); }
.payplan .payplan-hold { margin: 0; padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--dim); }
.payplan .payplan-scroll { overflow-x: auto; }

/* ---- Small screens ---- */
@media (max-width: 640px) {
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 16px; }
  .header-inner { gap: 8px; }
  .header-inner img { height: 40px; }
  .brand-name { font-size: 17px; }
  .site-nav { order: 3; flex-basis: 100%; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
}
