:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #627084;
  --line: #dbe3ef;
  --blue: #0f62fe;
  --blue-dark: #073fa8;
  --cyan: #dcecff;
  --green: #17a673;
  --red: #d64545;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  margin-top: 4px;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 38px 0 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.98;
}

h2 {
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.12;
}

.intro-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.intro-summary span {
  padding: 10px 12px;
  background: #e9eef6;
  border-radius: 6px;
}

.quote-form {
  display: grid;
  gap: 18px;
}

.section-band,
.offer-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}

.section-band.compact {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(260px, 1.25fr);
  align-items: center;
  gap: 24px;
}

.section-heading {
  margin-bottom: 20px;
}

.compact .section-heading {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c8d5e6;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
}

input:focus {
  outline: 3px solid rgba(15, 98, 254, 0.18);
  border-color: var(--blue);
}

.inline-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  align-self: end;
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button,
.ghost-button {
  border: 1px solid #c8d5e6;
  background: #fff;
  color: var(--ink);
}

.status-line {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.status-line.error {
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #eef4fb;
  color: #304156;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-weight: 650;
}

tr:last-child td {
  border-bottom: 0;
}

.product-name {
  padding: 0;
  background: transparent;
  color: var(--blue);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quantity-input {
  width: 96px;
}

.money {
  white-space: nowrap;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 96px);
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid #c8d5e6;
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
}

.segmented input:checked + span {
  border-color: var(--blue);
  background: var(--cyan);
  color: var(--blue-dark);
}

.quote-action {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.offer-panel {
  margin-top: 24px;
}

.offer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.offer-content {
  display: grid;
  gap: 18px;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.offer-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
}

.offer-box h3 {
  margin: 0 0 10px;
}

.offer-box p {
  margin: 5px 0;
  color: var(--muted);
  font-weight: 650;
}

.totals-table td:last-child,
.totals-table th:last-child {
  text-align: right;
}

.total-row td {
  background: #eef4fb;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.product-dialog {
  width: min(920px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(23, 32, 42, 0.42);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 40px;
  padding: 0;
  background: var(--ink);
  color: #fff;
}

.dialog-body {
  min-height: 360px;
  padding: 18px;
}

.dialog-body iframe {
  width: 100%;
  min-height: 70vh;
  border: 0;
}

.placeholder-card {
  display: grid;
  min-height: 320px;
  place-items: center;
  border: 1px dashed #b7c6d8;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

@media (max-width: 820px) {
  .topbar,
  .intro,
  .offer-header {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    justify-content: space-between;
  }

  .grid.two,
  .section-band.compact,
  .quote-action,
  .offer-grid {
    grid-template-columns: 1fr;
  }

  .intro-summary {
    grid-template-columns: 1fr 1fr;
  }

  th,
  td {
    min-width: 150px;
  }

  th:first-child,
  td:first-child {
    min-width: 230px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .quote-form,
  .intro,
  .secondary-button {
    display: none !important;
  }

  main {
    width: 100%;
    padding: 0;
  }

  .offer-panel {
    display: block !important;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
}
