/* ═══════════════════════════════════════════════════════════
   RateAtlas – Rate Finder  •  tool-specific styles
   tools.rateatlas.org/rate-finder/style.css
   ═══════════════════════════════════════════════════════════ */

.ra-tool {
  --ra-border: #dbe4f0;
  --ra-text: #0f172a;
  --ra-muted: #64748b;
  --ra-soft-bg: #f8fafc;
  --ra-accent: #4059AD;
  --ra-accent-2: #6B9AC4;
  --ra-chip-bg: #EFF2F1;
  --ra-chip-text: #4059AD;
  --ra-radius-xl: 20px;
  --ra-radius-lg: 16px;
  --ra-radius-md: 12px;
  --ra-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  font-family: "Inter", "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ra-text);
  margin: 6px auto 12px;
  max-width: 860px;
  padding: 0 12px;
  line-height: 1.6;
  font-size: 1.02rem;
}
.ra-tool, .ra-tool * { box-sizing: border-box; }
.ra-tool section, .ra-tool article, .ra-tool p, .ra-tool h1, .ra-tool h2, .ra-tool h3, .ra-tool ul { margin: 0; }
.ra-shell { width: 100%; margin: 0; }
.ra-tool > .ra-shell + .ra-shell { margin-top: 12px; }

/* ── Hero ── */
.ra-hero {
  padding: clamp(24px, 4vw, 36px);
  border-radius: var(--ra-radius-xl);
  color: #fff;
  background: linear-gradient(135deg, var(--ra-accent), var(--ra-accent-2));
}
.ra-hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 24ch;
}
.ra-hero p {
  margin-top: 12px;
  max-width: 58ch;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  font-size: 1rem;
  font-weight: 400;
}

/* ── Panel ── */
.ra-panel {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: var(--ra-radius-xl);
  padding: clamp(18px, 3vw, 24px);
  box-shadow: var(--ra-shadow-sm);
}
.ra-panel h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; color: #1e293b; }
.ra-panel > * + * { margin-top: 14px; }

/* ── Forms ── */
.ra-zip-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.ra-zip-btn-wrap { display: flex; align-items: end; }
.ra-field label { display: block; font-size: 0.88rem; font-weight: 700; margin-bottom: 6px; color: #1e293b; letter-spacing: 0.01em; }
.ra-field input, .ra-field select {
  width: 100%; border: 1px solid #cbd5e1; border-radius: var(--ra-radius-md);
  padding: 10px 12px; font-size: 0.95rem; line-height: 1.45;
  background: #fff; color: var(--ra-text); font-family: inherit;
}
.ra-field input:focus, .ra-field select:focus {
  outline: none; border-color: var(--ra-accent); box-shadow: 0 0 0 3px rgba(64,89,173,0.15);
}
.ra-field select { cursor: pointer; }

/* ── Buttons ── */
.ra-btn {
  border: 1px solid transparent; border-radius: var(--ra-radius-md);
  padding: 10px 16px; font-weight: 700; font-size: 0.9rem;
  line-height: 1; font-family: inherit; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; white-space: nowrap; transition: all 0.2s ease;
}
.ra-btn-primary { background: var(--ra-accent); color: #fff; }
.ra-btn-primary:hover { background: #3550a3; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(64,89,173,0.2); }
.ra-btn-ghost { background: #EFF2F1; color: #4059AD; border-color: #6B9AC4; }
.ra-btn-ghost:hover { background: #97D8C4; border-color: #4059AD; transform: translateY(-1px); }
.ra-link-btn {
  background: #EFF2F1; color: #4059AD; text-decoration: none;
  border: 1px solid #6B9AC4; border-radius: var(--ra-radius-md);
  padding: 8px 14px; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  margin-top: 2px; line-height: 1.4; transition: all 0.2s ease;
}
.ra-link-btn:hover { background: #97D8C4; border-color: #4059AD; transform: translateY(-1px); }
.ra-btn--geo {
  background: #f1f5f9; color: #334155; border-color: #cbd5e1;
  font-size: 1.1rem; padding: 7px 11px; min-width: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; gap: 0 !important;
}
.ra-btn--geo:hover { background: #e2e8f0; transform: translateY(-1px); }

/* ── Manual panel ── */
.ra-manual { margin-top: 8px; padding-top: 10px; border-top: 1px dashed #cbd5e1; display: none; }
.ra-manual.active { display: block; }
.ra-manual .ra-field { margin: 0; }
.ra-manual .ra-field label { margin-bottom: 4px; }
.ra-manual .ra-field input { margin-bottom: 0; }
.ra-manual .ra-inline-actions { margin-top: 4px; margin-bottom: 0; }
.ra-manual #citySuggest:empty, .ra-manual #allCityList:empty { display: none; }

/* ── Suggestions ── */
.ra-suggest { margin-top: 4px; list-style: none; padding: 0; border: 1px solid #e2e8f0; border-radius: var(--ra-radius-md); max-height: 170px; overflow: auto; background: #fff; }
.ra-suggest li { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; color: #334155; font-size: 0.88rem; line-height: 1.45; }
.ra-suggest li:last-child { border-bottom: 0; }
.ra-suggest li:hover { background: #eff2f1; }
.ra-suggest__meta { font-weight: 700; background: #f8fafc; color: #1e293b; font-size: 0.82rem; cursor: default; }
.ra-suggest__more { font-style: italic; color: #64748b; font-size: 0.82rem; cursor: default; }

/* ── Meta / helpers ── */
.ra-meta { color: var(--ra-muted); font-size: 0.9rem; line-height: 1.5; }
.ra-inline-actions { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ra-helper { margin-top: 8px; color: #94a3b8; line-height: 1.5; font-size: 0.82rem; }
.ra-field-hint { margin-top: 5px; color: #64748b; font-size: 0.82rem; line-height: 1.4; }

/* ── Provider box ── */
.ra-provider-box { margin-top: 10px; display: grid; grid-template-columns: 1fr; gap: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0; }
.ra-chip-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.ra-chip {
  background: var(--ra-chip-bg); color: var(--ra-chip-text);
  border: 1px solid transparent; border-radius: 999px;
  padding: 7px 12px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; line-height: 1.25;
}
.ra-chip:hover { filter: brightness(0.98); }
.ra-chip.is-active { background: var(--ra-accent); color: #fff; border-color: var(--ra-accent); }

/* ── Advanced panel ── */
.ra-advanced { margin-top: 8px; border-top: 1px dashed #cbd5e1; padding-top: 10px; display: none; }
.ra-inline-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }

/* ── Results ── */
.ra-results { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; }
.ra-card { background: #fff; border: 1px solid var(--ra-border); border-radius: var(--ra-radius-lg); padding: 16px; }
.ra-card h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; color: #1e293b; }
.ra-big { font-size: clamp(1.8rem, 3.3vw, 2.3rem); font-weight: 800; margin: 8px 0; letter-spacing: -0.02em; }
.ra-muted { color: #64748b; font-size: 0.92rem; line-height: 1.5; }
.ra-bars { margin-top: 8px; display: grid; gap: 8px; }
.ra-bar-row { display: grid; grid-template-columns: 65px 1fr 84px; gap: 10px; align-items: center; }
.ra-bar-track { height: 12px; background: #e5edf7; border-radius: 999px; overflow: hidden; }
.ra-bar-fill { height: 100%; background: linear-gradient(90deg, var(--ra-accent), var(--ra-accent-2)); border-radius: 999px; }
.ra-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.88rem; }
.ra-table th, .ra-table td { border-bottom: 1px solid #e2e8f0; text-align: left; padding: 8px 6px; vertical-align: top; line-height: 1.45; }
.ra-table th { color: #1e293b; font-size: 0.82rem; letter-spacing: 0.01em; font-weight: 700; }
.ra-disclaimer { color: var(--ra-muted); font-size: 0.82rem; line-height: 1.5; padding: 0 2px; }

/* ── State tag ── */
.ra-state-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #4059AD, #6B9AC4);
  color: #fff; font-size: 0.78rem; font-weight: 800;
  padding: 5px 14px; border-radius: 99px;
  letter-spacing: 0.04em; text-transform: uppercase; margin-top: 14px;
}
.ra-state-tag::before { content: '\1F4CD'; font-size: 0.85em; }

/* ── Location panel ── */
.ra-location-panel {
  margin-bottom: 14px; padding: 20px;
  border: 1px solid #f0f0f0; border-radius: 20px; background: #fff;
  display: grid; grid-template-columns: 1.4fr 0.85fr; gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: box-shadow 0.2s ease;
}
.ra-location-panel:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.ra-location-main { display: grid; gap: 10px; }
.ra-location-side { border-left: 1px dashed #f1f5f9; padding-left: 16px; }
.ra-location-main label, .ra-location-side label { font-size: 0.82rem; font-weight: 700; color: #475569; letter-spacing: -0.01em; }
.ra-inline { display: flex; gap: 8px; align-items: end; }
.ra-inline input {
  flex: 1; min-width: 0; padding: 10px 14px;
  border: 1px solid #e2e8f0; border-radius: 12px;
  font-size: 0.88rem; transition: all 0.2s ease; outline: none;
}
.ra-inline input:focus { border-color: #4059AD; box-shadow: 0 0 0 3px rgba(64,89,173,0.15); }
.ra-utility-badge {
  margin-top: 4px; background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff; border-radius: 14px; padding: 10px 16px;
  display: inline-block; font-size: 0.9rem; font-weight: 800; letter-spacing: -0.01em;
}
.ra-utility-type { margin-top: 8px; font-size: 0.81rem; color: #94a3b8; }
.ra-unsupported-warning {
  margin-top: 10px; padding: 10px 14px; border-radius: 12px;
  background: #fef3c7; border: 1px solid #fbbf24; color: #92400e;
  font-size: 0.84rem; font-weight: 600; line-height: 1.5; display: none;
}
.ra-unsupported-warning.active { display: block; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .ra-results { grid-template-columns: 1fr; }
  .ra-inline-grid { grid-template-columns: 1fr; }
  .ra-zip-row { grid-template-columns: 1fr; }
  .ra-location-panel { grid-template-columns: 1fr; }
  .ra-location-side { border-left: 0; border-top: 1px dashed #f1f5f9; padding: 12px 0 0; }
  .ra-inline { flex-direction: column; align-items: stretch; }
  .ra-inline .ra-btn { width: 100%; }
  .ra-zip-row .ra-zip-btn-wrap { align-items: stretch; }
  .ra-zip-row .ra-btn { width: 100%; }
}
