/* ============ PoolCop Configurator — Brand Chart compliant ============
   Core:    #0086BF (PoolCop blue) / #1B365D (navy)
   Accents: #22A6DF (light blue)   / #FCA01A (orange)
   Greys:   #A4A4A4 / #D8D8D8
   Fonts:   Raleway (content) / Segoe UI (interface & pricing)          */

:root {
  --blue: #0086BF;
  --navy: #1B365D;
  --sky: #22A6DF;
  --orange: #FCA01A;
  --grey: #A4A4A4;
  --grey-light: #D8D8D8;
  --bg: #F4F8FB;
  --card: #FFFFFF;
  --ink: #1B365D;
  --ink-soft: #47607f;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(27, 54, 93, 0.08), 0 8px 24px rgba(27, 54, 93, 0.07);
  --shadow-lift: 0 4px 12px rgba(27, 54, 93, 0.12), 0 16px 40px rgba(27, 54, 93, 0.12);
  --font-content: "Raleway", "Segoe UI", sans-serif;
  --font-ui: "Segoe UI", "Raleway", -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-content);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- Header ---------- */
.topbar {
  background: linear-gradient(120deg, #ffffff 0%, #eaf5fb 100%);
  border-bottom: 3px solid var(--blue);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand-logo { height: 58px; width: auto; }
.topbar-title h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.topbar-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
}

/* ---------- Steps nav ---------- */
.steps {
  max-width: 1200px;
  margin: 26px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--grey-light);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 18px 8px 8px;
  font-family: var(--font-content);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--grey-light);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  transition: all 0.22s ease;
}
.step.active {
  border-color: var(--blue);
  color: var(--navy);
  box-shadow: var(--shadow);
}
.step.active .step-num { background: var(--blue); color: #fff; }
.step.done .step-num { background: var(--sky); color: #fff; }
.step:not(.active):hover { border-color: var(--sky); }

/* ---------- Layout ---------- */
.layout {
  max-width: 1200px;
  margin: 22px auto 60px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 26px;
  align-items: start;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 32px 26px;
  animation: rise 0.35s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.panel-sub { color: var(--ink-soft); margin: 6px 0 24px; }

.panel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e8eef4;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-content);
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0074a6; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-primary:disabled { background: var(--grey-light); color: var(--grey); cursor: not-allowed; }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: #e8920d; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--grey-light); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Step 1 : family cards ---------- */
.family-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.family-card {
  border: 2px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  background: #fff;
  transition: all 0.22s ease;
  position: relative;
}
.family-card:hover { border-color: var(--sky); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.family-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 134, 191, 0.15), var(--shadow-lift); }
.family-card img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  margin-bottom: 14px;
}
.family-card h3 {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--blue);
}
.family-card .tagline {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 4px 0 12px;
  min-height: 2.4em;
}
.family-card ul { list-style: none; }
.family-card li {
  font-size: 0.83rem;
  color: var(--ink);
  padding: 3.5px 0 3.5px 22px;
  position: relative;
}
.family-card li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--sky);
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="black" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.7 5.9-4.2 4.6a.8.8 0 0 1-1.2 0L4.3 8.3a.8.8 0 1 1 1.2-1.1l1.4 1.5 3.6-4a.8.8 0 1 1 1.2 1.2z"/></svg>') center/contain no-repeat;
}
.check-badge {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.22s ease;
}
.family-card.selected .check-badge,
.config-card.selected .check-badge { opacity: 1; transform: scale(1); }

/* ---------- Step 2 : configuration cards ---------- */
.config-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.config-card {
  border: 2px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.config-card:hover { border-color: var(--sky); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.config-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 134, 191, 0.15), var(--shadow-lift); }
.config-card img { width: 100%; height: 130px; object-fit: contain; margin-bottom: 12px; }
.config-card h3 { font-size: 0.98rem; font-weight: 700; color: var(--navy); }
.config-card .desc { font-size: 0.79rem; color: var(--ink-soft); margin: 6px 0 12px; flex: 1; }
.config-card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid #e8eef4;
  padding-top: 10px;
}
.config-card .ref { font-family: var(--font-ui); font-size: 0.74rem; color: var(--grey); }
.config-card .price {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
}

.toggle-card {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1.5px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 18px 22px;
  background: linear-gradient(120deg, #fbfdfe, #eef7fc);
}
.toggle-card h3 { font-size: 0.98rem; font-weight: 700; color: var(--navy); }
.toggle-card p { font-size: 0.82rem; color: var(--ink-soft); }

.switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--grey-light);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.25s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: 0.25s;
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(24px); }

/* ---------- Step 3 : options ---------- */
.opt-group {
  border: 1.5px solid var(--grey-light);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
}
.opt-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.opt-group summary::-webkit-details-marker { display: none; }
.opt-group summary:hover { background: #f6fafd; }
.opt-group-title { display: flex; flex-direction: column; gap: 2px; }
.opt-group-title h3 { font-size: 0.98rem; font-weight: 700; color: var(--navy); }
.opt-group-title p { font-size: 0.79rem; color: var(--ink-soft); font-weight: 400; }
.opt-group-meta { display: flex; align-items: center; gap: 12px; }
.opt-count {
  background: var(--blue);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
  display: none;
}
.opt-count.show { display: inline-block; }
.chev { transition: transform 0.25s; color: var(--grey); flex-shrink: 0; }
.opt-group[open] .chev { transform: rotate(180deg); }
.opt-items { border-top: 1px solid #e8eef4; }

.opt-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.15s;
}
.opt-row:last-child { border-bottom: none; }
.opt-row:hover { background: #f8fbfd; }
.opt-row.on { background: #eef7fc; }

.opt-check {
  appearance: none;
  width: 21px; height: 21px;
  border: 2px solid var(--grey);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 0.18s;
}
.opt-check:checked { background: var(--blue); border-color: var(--blue); }
.opt-check:checked::before {
  content: "";
  width: 11px; height: 11px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path fill="none" stroke="white" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" d="M1.5 6.5 4.5 9.5 10.5 2.5"/></svg>') center/contain no-repeat;
}

.opt-info { flex: 1; min-width: 0; }
.opt-name { font-size: 0.87rem; font-weight: 600; color: var(--ink); }
.opt-note { font-size: 0.76rem; color: var(--ink-soft); }
.opt-ref { font-family: var(--font-ui); font-size: 0.72rem; color: var(--grey); }
.opt-price {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--blue);
  white-space: nowrap;
}
.opt-hint {
  font-size: 0.72rem;
  color: var(--orange);
  font-weight: 600;
}

.qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--grey-light);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.qty button {
  width: 30px; height: 30px;
  border: none;
  background: #f2f6fa;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.qty button:hover { background: var(--sky); color: #fff; }
.qty span {
  width: 34px;
  text-align: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
}

.opt-select {
  width: 100%;
  font-family: var(--font-content);
  font-size: 0.85rem;
  padding: 10px 12px;
  border: 1.5px solid var(--grey-light);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  margin: 6px 0;
}
.opt-select:focus { outline: none; border-color: var(--blue); }
.select-wrap { padding: 12px 20px; }
.select-line { display: flex; gap: 12px; align-items: center; }
.select-line .qty { margin-left: auto; }

/* ---------- Step 4 : quote ---------- */
.quote-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field-wide { grid-column: 1 / -1; }
.field label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.field input {
  font-family: var(--font-content);
  font-size: 0.9rem;
  padding: 11px 14px;
  border: 1.5px solid var(--grey-light);
  border-radius: 9px;
  color: var(--ink);
  transition: border 0.18s;
}
.field input:focus { outline: none; border-color: var(--blue); }

.quote-table-wrap { overflow-x: auto; }
.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}
.quote-table th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.quote-table th:first-child { border-radius: 8px 0 0 0; }
.quote-table th:last-child { border-radius: 0 8px 0 0; }
.quote-table td { padding: 9px 12px; border-bottom: 1px solid #e8eef4; }
.quote-table .num { text-align: right; white-space: nowrap; }
.quote-table .section td {
  background: #eef7fc;
  font-weight: 700;
  color: var(--blue);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.quote-table tfoot .grand td {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  border-top: 2.5px solid var(--blue);
  border-bottom: none;
  padding-top: 13px;
}
.quote-legal { font-size: 0.73rem; color: var(--grey); margin-top: 16px; }

/* ---------- Summary sidebar ---------- */
.summary {
  position: sticky;
  top: 20px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.summary-head {
  padding: 18px 22px 14px;
  background: linear-gradient(120deg, #35B0E6, #0086BF);
}
.summary-head h3 { font-size: 1rem; font-weight: 700; }
.summary-body {
  padding: 14px 22px;
  max-height: 46vh;
  overflow-y: auto;
}
.summary-empty { font-size: 0.84rem; color: #9fb4cd; }
.sum-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  padding: 5px 0;
  animation: rise 0.25s ease both;
}
.sum-line .lbl { color: #d9e6f2; }
.sum-line .val { font-family: var(--font-ui); font-weight: 600; white-space: nowrap; }
.sum-line.head { font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 4px; padding-bottom: 8px; }
.sum-line.head .lbl { color: var(--sky); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 22px 6px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.summary-total span { font-size: 0.8rem; color: #9fb4cd; }
.summary-total strong { font-family: var(--font-ui); font-size: 1.45rem; font-weight: 700; color: #fff; }
.summary-note { padding: 0 22px 18px; font-size: 0.7rem; color: #9fb4cd; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--grey-light);
  background: #fff;
  padding: 26px 24px 32px;
  text-align: center;
}
.footer-logo { height: 30px; margin-bottom: 10px; }
.footer p { font-size: 0.76rem; color: var(--grey); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }
  .summary-body { max-height: 200px; }
  .config-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .family-grid { grid-template-columns: 1fr; }
  .quote-form { grid-template-columns: 1fr; }
  .panel { padding: 22px 18px; }
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .steps { gap: 6px; }
  .step { padding: 6px 12px 6px 6px; font-size: 0.78rem; }
}
