/* ═══════════════════════════════════════════════════════════
   RateAtlas – Compare Plans  •  tool-specific styles
   tools.rateatlas.org/compare-plans/style.css
   ═══════════════════════════════════════════════════════════ */

.cp-page {
  font-family: "Inter","SF Pro Display","Segoe UI",system-ui,-apple-system,sans-serif;
  color: #0f172a; max-width: 940px; margin: 0 auto; padding: 24px 16px 40px;
  line-height: 1.6; font-size: 1.02rem;
}
.cp-page *, .cp-page *::before, .cp-page *::after { box-sizing: border-box; }
.cp-page section, .cp-page h1, .cp-page h2, .cp-page h3, .cp-page p { margin: 0; }
.cp-page ::-webkit-scrollbar { width: 6px; height: 6px; }
.cp-page ::-webkit-scrollbar-track { background: transparent; }
.cp-page ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.cp-page ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.cp-page { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

/* ── Hero ── */
.cp-hero {
  background: linear-gradient(135deg, #4059AD 0%, #6B9AC4 100%);
  border-radius: 20px; padding: clamp(28px,4vw,44px) clamp(24px,4vw,36px);
  color: #fff; position: relative; overflow: hidden;
}
.cp-hero::before {
  content: ''; position: absolute; top: -60%; right: -15%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.cp-hero h1 {
  font-size: clamp(1.6rem,4vw,2.4rem); line-height: 1.1;
  letter-spacing: -0.03em; font-weight: 800; position: relative;
}
.cp-hero-sub {
  margin-top: 12px; color: rgba(255,255,255,0.9); max-width: 60ch;
  line-height: 1.6; font-size: 1rem; position: relative;
}
.cp-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;
  position: relative;
}
.cp-state-tag::before { content: '\1F4CD'; font-size: 0.85em; }
.cp-nav { margin-top: 18px; display: flex; gap: 6px; flex-wrap: wrap; position: relative; }
.cp-nav a {
  color: #4059AD; text-decoration: none; font-size: 0.82rem; font-weight: 600;
  padding: 6px 14px; border-radius: 99px;
  background: #EFF2F1; border: 1px solid #6B9AC4; transition: all 0.2s ease;
}
.cp-nav a:hover { background: #97D8C4; border-color: #4059AD; transform: translateY(-1px); }

/* ── Location Panel ── */
.cp-location-panel {
  margin: 20px 0; 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;
}
.cp-location-panel:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.cp-location-main { display: grid; gap: 10px; }
.cp-location-side { border-left: 1px dashed #f1f5f9; padding-left: 16px; }
.cp-location-main label, .cp-control-group label {
  font-size: 0.82rem; font-weight: 700; color: #475569; letter-spacing: -0.01em;
}
.cp-inline { display: flex; gap: 8px; align-items: end; }
.cp-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;
}
.cp-inline input:focus { border-color: #4059AD; box-shadow: 0 0 0 3px rgba(64,89,173,0.15); }

/* ── Buttons ── */
.cp-btn {
  border: 1px solid transparent; border-radius: 12px; padding: 10px 18px;
  font-size: 0.85rem; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; transition: all 0.2s ease; font-family: inherit;
}
.cp-btn:disabled, .cp-btn.is-disabled {
  background: #cbd5e1 !important; color: #475569 !important;
  border-color: #cbd5e1 !important; cursor: not-allowed !important;
}
.cp-btn-primary {
  background: linear-gradient(135deg, #4059AD, #6B9AC4);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(64,89,173,0.25);
}
.cp-btn-primary:hover { box-shadow: 0 4px 16px rgba(64,89,173,0.35); transform: translateY(-1px); }
.cp-btn-geo {
  background: #f1f5f9; color: #334155; border-color: #cbd5e1;
  font-size: 1.1rem; padding: 7px 11px; min-width: 38px;
}
.cp-btn-geo:hover { background: #e2e8f0; transform: translateY(-1px); }
.cp-btn-green {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}
.cp-btn-green:hover { box-shadow: 0 4px 16px rgba(22,163,74,0.35); transform: translateY(-1px); }
.cp-btn-ghost { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.cp-btn-ghost:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* ── Utility Badge ── */
.cp-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;
}
.cp-utility-type { margin-top: 8px; font-size: 0.81rem; color: #94a3b8; }
.cp-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;
}
.cp-unsupported-warning.active { display: block; }

/* ── Controls ── */
.cp-controls {
  margin: 16px 0; padding: 20px; background: #fff; border: 1px solid #f0f0f0;
  border-radius: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cp-control-group { display: flex; flex-direction: column; gap: 6px; }
.cp-control-group select, .cp-control-group input[type=range], .cp-control-group input[type=text] { width: 100%; }
.cp-control-group select {
  padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 12px;
  font-size: 0.88rem; outline: none; transition: all 0.2s ease; background: #fff;
}
.cp-control-group select:focus { border-color: #4059AD; box-shadow: 0 0 0 3px rgba(64,89,173,0.15); }
.cp-control-group input[type=range] {
  -webkit-appearance: none; height: 6px; background: #f1f5f9;
  border-radius: 99px; outline: none;
}
.cp-control-group input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #4059AD, #6B9AC4);
  cursor: pointer; box-shadow: 0 2px 6px rgba(64,89,173,0.3);
}
.cp-control-group strong { font-size: 0.88rem; color: #4059AD; font-variant-numeric: tabular-nums; }
.cp-control-group-upload { grid-column: 1 / -1; position: relative; }
.cp-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cp-label-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-coming-soon {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.8rem;
  font-weight: 600;
}
.cp-info-details { position: relative; }
.cp-info-details summary { list-style: none; }
.cp-info-details summary::-webkit-details-marker { display: none; }
.cp-info-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #1e293b;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800; cursor: pointer; user-select: none;
}
.cp-info-btn:hover, .cp-info-details[open] .cp-info-btn {
  border-color: #16a34a; background: #f0fdf4; color: #166534;
}
.cp-info-pill {
  min-height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #334155;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; cursor: pointer; user-select: none;
}
.cp-info-pill:hover, .cp-info-details[open] .cp-info-pill {
  border-color: #16a34a; background: #f0fdf4; color: #166534;
}
.cp-info-popover {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 20;
  width: min(360px, calc(100vw - 48px));
  padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px solid #dbeafe;
  box-shadow: 0 18px 36px rgba(15,23,42,0.12);
}
.cp-info-details-wide .cp-info-popover { right: 0; }
.cp-info-popover-wide { width: min(420px, calc(100vw - 48px)); }
.cp-info-popover p { font-size: 0.79rem; color: #334155; line-height: 1.55; }
.cp-info-popover p + p { margin-top: 8px; }
.cp-info-list {
  margin: 8px 0 0 18px; padding: 0; color: #334155; font-size: 0.79rem;
}
.cp-info-list li + li { margin-top: 4px; }

/* ── Upload Zone ── */
.cp-upload-zone {
  margin-top: 6px; border: 2px dashed #e2e8f0; border-radius: 16px; padding: 16px;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 12px; cursor: pointer; transition: all 0.25s ease;
}
.cp-upload-zone:hover, .cp-upload-zone.is-drag {
  border-color: #16a34a;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: 0 8px 24px rgba(6,78,59,0.08); transform: translateY(-1px);
}
.cp-upload-zone:focus-visible {
  border-color: #16a34a; outline: none;
  box-shadow: 0 0 0 4px rgba(22,163,74,0.14);
}
.cp-upload-zone.has-file {
  border-color: #16a34a;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}
.cp-upload-zone.is-disabled { cursor: not-allowed; pointer-events: none; }
.cp-upload-icon { font-size: 1.3rem; line-height: 1; }
.cp-upload-title { font-size: 0.86rem; font-weight: 700; color: #1e293b; }
.cp-upload-sub { margin-top: 3px; color: #94a3b8; font-size: 0.78rem; line-height: 1.4; }
.cp-upload-btn { padding-inline: 14px; border-radius: 12px; }
.cp-clear-wrap { margin-top: 8px; display: flex; justify-content: flex-end; }
.cp-clear-wrap.is-hidden { display: none; }
.cp-helper { margin-top: 8px; color: #94a3b8; line-height: 1.5; font-size: 0.82rem; }
.cp-helper.is-error { color: #b91c1c; }
.cp-state-row { margin-bottom: 2px; }
.cp-state-row select { max-width: 260px; }

/* ── City List ── */
.cp-city-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid #f0f0f0; border-radius: 12px;
  max-height: 140px; overflow: auto; display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.cp-city-list li { padding: 10px 14px; border-bottom: 1px solid #f8fafc; font-size: 0.84rem; color: #334155; }
.cp-city-list li:hover { background: #EFF2F1; }
.cp-city-list li:last-child { border-bottom: 0; }

/* ── Service Chips ── */
.cp-service-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-service-chip {
  border-radius: 12px; border: 1px solid #e2e8f0;
  padding: 8px 14px; font-size: 0.82rem; font-weight: 700;
  background: #fff; color: #475569; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center; transition: all 0.2s ease;
  font-family: inherit;
}
.cp-service-chip:hover { background: #EFF2F1; border-color: #6B9AC4; color: #4059AD; }
.cp-service-chip.is-active {
  background: linear-gradient(135deg, #4059AD, #6B9AC4);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(64,89,173,0.25);
}
.cp-service-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.cp-control-group-upload #cpCsvFile {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}

/* ── Results Grid ── */
#cpResults {
  margin-top: 16px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px;
}

/* ── Plan Cards ── */
.cp-plan-card {
  border: 1px solid #f0f0f0; border-radius: 18px; background: #fff;
  padding: 18px; transition: all .25s ease; position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cp-plan-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.07); transform: translateY(-2px); }
.cp-plan-card.cp-best {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.12), 0 4px 16px rgba(34,197,94,0.08);
}
.cp-plan-card.cp-best::before {
  content: "Best Value"; position: absolute; top: -11px; right: 14px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 3px 12px; border-radius: 99px;
}
.cp-plan-card h3 { font-size: 0.92rem; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.cp-plan-card .cp-kind { font-size: 0.75rem; color: #94a3b8; margin-bottom: 8px; }
.cp-plan-card .cp-service { font-size: 0.72rem; color: #475569; margin-bottom: 4px; }
.cp-plan-card .cp-big {
  font-size: 1.7rem; font-weight: 800; color: #4059AD;
  margin: 6px 0; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.cp-plan-card .cp-rate { font-size: 0.85rem; color: #475569; }
.cp-plan-card .cp-detail { font-size: 0.78rem; color: #94a3b8; margin-top: 6px; }
.cp-plan-card .cp-bars { margin-top: 10px; }
.cp-plan-card .cp-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cp-plan-card .cp-bar-lbl { font-size: 0.72rem; font-weight: 600; color: #64748b; width: 65px; text-align: right; }
.cp-plan-card .cp-bar-trk {
  flex: 1; height: 16px; background: #f8fafc; border-radius: 8px;
  overflow: hidden; border: 1px solid #f1f5f9;
}
.cp-plan-card .cp-bar-fl { height: 100%; border-radius: 8px; transition: width .4s cubic-bezier(0.4,0,0.2,1); }
.cp-plan-card .cp-bar-val { font-size: 0.72rem; font-weight: 700; color: #1e293b; width: 55px; font-variant-numeric: tabular-nums; }
.cp-phase-badge, .cp-type-chip {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 2px 9px; border-radius: 99px;
  background: #eff6ff; color: #2563eb; margin-bottom: 6px;
}
.cp-type-chip { margin-right: 6px; background: #EFF2F1; color: #4059AD; border: 1px solid #99f6e4; }

/* ── Swap Note ── */
.cp-note {
  margin-top: 20px; padding: 20px; border: 1px solid #bbf7d0; border-radius: 18px;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
  font-size: 0.88rem; color: #166534; line-height: 1.6;
}
.cp-note h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.cp-note .cp-swap-item { margin: 8px 0; padding: 8px 0; border-bottom: 1px solid #dcfce7; }

/* ── Footer ── */
.cp-footer {
  margin-top: 28px; padding: 18px 0; border-top: 1px solid #f1f5f9;
  font-size: 0.82rem; color: #94a3b8;
}
.cp-footer .cp-nav { margin-top: 10px; }
.cp-footer .cp-nav a { color: #4059AD; background: #EFF2F1; border-color: #6B9AC4; }
.cp-footer .cp-nav a:hover { background: #97D8C4; color: #4059AD; }

/* ── SEO Copy ── */
.cp-seo-copy {
  margin-top: 12px;
  padding: 14px 2px 0;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.7;
}
.cp-seo-copy h2 {
  margin: 0 0 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #475569;
}
.cp-seo-copy p + p { margin-top: 8px; }

@media (max-width: 900px) {
  .cp-location-panel { grid-template-columns: 1fr; }
  .cp-location-side { border-left: 0; border-top: 1px dashed #f1f5f9; padding: 12px 0 0; }
}
@media (max-width: 700px) {
  .cp-controls { grid-template-columns: 1fr; }
  #cpResults { grid-template-columns: 1fr; }
  .cp-label-row { align-items: flex-start; }
  .cp-label-actions { justify-content: flex-start; }
  .cp-info-popover {
    right: auto; left: 0; width: min(100%, calc(100vw - 48px));
  }
  .cp-info-popover-wide { width: min(100%, calc(100vw - 48px)); }
  .cp-nav a { font-size: 0.78rem; padding: 5px 10px; }
}
