/* Cesar & Associates — Med Supp Quoter — V1 sky-blue skin */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7fbff;
  --bg2: #e8f4fd;
  --panel: rgba(255,255,255,.92);
  --text: #15324b;
  --muted: #53697a;
  --faint: #60798a;
  --line: #cfe5f5;
  --sky: #4a8db7;
  --sky2: #2e7dc9;
  --accent: #ce1f31;
  --gold: #c4922a;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Georgia, serif;
  --sidebar-w: 280px;
  --radius: 8px;
}

html { font-size: 15px; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.demo-banner {
  background: #b3261e;
  color: #fff;
  font: 700 .92rem/1.4 system-ui, -apple-system, sans-serif;
  padding: .65rem 1rem;
  text-align: center;
  letter-spacing: .01em;
}

/* ── Shell ── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--text);
  color: rgba(255,255,255,.88);
  padding: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  flex-shrink: 0;
}
.brand img { height: 32px; width: auto; object-fit: contain; }
.brand strong { display: block; font-size: .88rem; color: #fff; line-height: 1.3; }
.brand span { font-size: .72rem; color: rgba(255,255,255,.5); letter-spacing: .04em; }

.quote-form { flex: 1; display: flex; flex-direction: column; padding: .5rem 0 1rem; }

.control-section {
  padding: .85rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.control-section h2 {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
  margin-bottom: .7rem;
}

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .6rem; }

label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  letter-spacing: .02em;
}
label input, label select {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  color: #fff;
  font-size: .82rem;
  padding: .42rem .55rem;
  width: 100%;
  outline: none;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
}
label input:focus, label select:focus { border-color: var(--sky); }
label select option { background: #1a3a5c; color: #fff; }
button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.control-section label.check-row {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.65);
  font-size: .8rem;
  cursor: pointer;
  margin-top: .6rem;
}
.carrier-filter { margin-top: .5rem; }
.control-section label.check-row input[type="checkbox"] {
  width: 15px; height: 15px;
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--sky);
}

/* Plan picker */
.plan-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.plan-option { cursor: pointer; }
.plan-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.plan-option span {
  display: block;
  padding: .28rem .65rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  font-size: .74rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  transition: all .15s;
  user-select: none;
}
.plan-option input:checked + span {
  background: var(--sky2);
  border-color: var(--sky2);
  color: #fff;
}
.plan-option:hover span { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.85); }

/* Segmented */
.segmented {
  display: flex;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: .65rem;
}
.segment {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: .78rem;
  font-weight: 600;
  padding: .4rem;
  cursor: pointer;
  transition: all .15s;
}
.segment.active { background: var(--sky2); color: #fff; }

/* Form actions */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .85rem 1.2rem;
  margin-top: auto;
}
.form-actions .primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 700;
  padding: .7rem;
  cursor: pointer;
  transition: opacity .15s;
}
.form-actions .primary:hover { opacity: .88; }
.form-actions #resetButton {
  background: transparent;
  color: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  font-size: .8rem;
  padding: .55rem;
  cursor: pointer;
  transition: all .15s;
}
.form-actions #resetButton:hover { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.25); }

/* ── Workspace ── */
.workspace { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.topbar .eyebrow {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: .15rem;
}
.topbar-actions { display: flex; gap: .5rem; }
.topbar-actions button {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  padding: .45rem .9rem;
  cursor: pointer;
  transition: all .15s;
}
.topbar-actions button:hover { background: var(--line); color: var(--text); }

/* Status band */
.status-band {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  overflow-x: auto;
}
.status-band > div {
  flex: 1;
  min-width: 0;
  padding: .6rem 1.2rem;
  border-right: 1px solid var(--line);
}
.status-band > div:last-child { border-right: none; }
.metric-label {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .15rem;
}
.status-band strong { font-size: .88rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Content grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 0;
  flex: 1;
  min-height: 0;
}

.results-area { padding: 1.2rem 1.5rem; min-width: 0; }

.results-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.results-toolbar h2 { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .15rem; }
.results-toolbar p { font-size: .72rem; color: var(--faint); }
.results-toolbar label {
  flex-direction: row;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
}
.results-toolbar label select {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: .38rem .55rem;
  font-size: .78rem;
}

/* Quote cards */
.results-list { display: grid; grid-template-columns: 1fr; gap: .7rem; }

.quote-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .8rem 1.2rem;
  align-items: start;
  box-shadow: 0 2px 10px rgba(74,141,183,.07);
  transition: box-shadow .15s, border-color .15s;
}
.quote-card:hover { border-color: rgba(46,125,201,.25); box-shadow: 0 4px 18px rgba(74,141,183,.12); }

.carrier-name {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: .3rem;
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sky2), var(--sky));
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.quote-meta { font-size: .75rem; color: var(--muted); margin-bottom: .35rem; }

.badge-row { display: flex; flex-wrap: wrap; gap: .3rem; }
.badge {
  font-size: .62rem;
  font-weight: 600;
  padding: .18rem .55rem;
  border-radius: 100px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--faint);
}
.badge.gold {
  background: rgba(196,146,42,.1);
  border-color: rgba(196,146,42,.3);
  color: var(--gold);
}

.benefit-grid { align-self: center; }
.benefit-row {
  display: flex;
  gap: .5rem;
  font-size: .73rem;
  color: var(--muted);
  padding: .15rem 0;
}
.benefit-row strong { color: var(--text); font-weight: 600; white-space: nowrap; }

.price-box { text-align: right; align-self: center; }
.price { font-size: 1.4rem; font-weight: 800; color: var(--sky2); line-height: 1.1; }
.quote-actions { margin-top: .55rem; }
.quote-actions button {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--sky2);
  font-size: .75rem;
  font-weight: 600;
  padding: .35rem .8rem;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.quote-actions button:hover { background: var(--sky2); color: #fff; border-color: var(--sky2); }

/* Compare panel */
.compare-panel {
  border-left: 1px solid var(--line);
  background: var(--bg);
  padding: 1rem 1rem;
  min-width: 0;
}
.compare-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .8rem;
  gap: .5rem;
}
.compare-header h2 { font-size: .88rem; font-weight: 700; color: var(--text); }
#compareHint { font-size: .68rem; color: var(--faint); }
.compare-list { display: flex; flex-direction: column; gap: .5rem; }
.compare-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .8rem;
  font-size: .78rem;
}
.compare-item header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .3rem;
  font-weight: 600;
  color: var(--text);
}
.compare-item header button {
  background: none;
  border: none;
  color: var(--faint);
  font-size: .68rem;
  cursor: pointer;
  padding: 0 .2rem;
}
.compare-item header button:hover { color: var(--accent); }
.compare-item p { color: var(--muted); line-height: 1.45; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--faint);
  font-size: .82rem;
}

.error-state {
  border: 1px solid rgba(206,31,49,.26);
  border-radius: 8px;
  background: #fff5f5;
  color: var(--text);
  padding: 1.2rem;
}
.error-state strong {
  display: block;
  color: var(--accent);
  font-size: .95rem;
  margin-bottom: .35rem;
}
.error-state p {
  color: var(--muted);
  font-size: .82rem;
}
.error-state code {
  background: rgba(206,31,49,.08);
  border-radius: 5px;
  padding: .08rem .25rem;
}

/* Data warning strip */
.quote-card.data-warning { border-top: 2px solid rgba(196,146,42,.35); }

/* ── Mobile ── */
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .compare-panel { border-left: none; border-top: 1px solid var(--line); }
  .quote-card { grid-template-columns: 1fr; }
  .price-box { text-align: left; }
  .topbar { flex-wrap: wrap; }
  .status-band { flex-wrap: nowrap; overflow-x: auto; }
}
@media (max-width: 420px) {
  .field-grid { grid-template-columns: 1fr; }
}
