:root {
  --bg: #f6f6f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6a6d75;
  --line: #dedfe4;
  --blue: #1167e8;
  --blue-dark: #0a47a7;
  --magenta: #d30b83;
  --violet: #5b22a8;
  --mint: #0f8d74;
  --soft-blue: #edf5ff;
  --soft-mint: #eef8f5;
  --soft-gray: #f0f1f4;
  --red: #c93636;
  --brand-gradient: linear-gradient(135deg, var(--magenta), var(--violet) 48%, var(--blue));
  --shadow: 0 18px 50px rgba(29, 29, 31, 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: 10px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 150px;
  height: auto;
}

.brand small,
nav {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

nav {
  display: flex;
  gap: 18px;
}

nav a {
  text-decoration: none;
}

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

.intro {
  padding: 36px 0 26px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.12;
}

h3 {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.quote-form,
main {
  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-heading {
  margin-bottom: 20px;
}

.split-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

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

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

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

.buyer-heading {
  align-items: end;
}

.buyer-code-field {
  width: min(430px, 100%);
}

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

input,
select {
  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,
select:focus {
  outline: 3px solid rgba(15, 98, 254, 0.18);
  border-color: var(--blue);
}

input[readonly] {
  background: var(--soft-gray);
  color: #526174;
}

.inline-action {
  display: grid;
  grid-template-columns: minmax(0, 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 {
  background: var(--brand-gradient);
  color: #fff;
}

.primary-button:hover {
  filter: brightness(0.94);
}

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

.builder-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(440px, 1.15fr);
  gap: 18px;
  margin-top: 18px;
}

.builder-pane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcff;
}

.pane-heading p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.fields-stack {
  display: grid;
  gap: 14px;
}

.required-note {
  display: block;
  min-height: 46px;
  border: 1px solid #c8d5e6;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pricing-table td:nth-child(3),
.pricing-table td:nth-child(4),
.pricing-table th:nth-child(3),
.pricing-table th:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.pricing-table td:nth-child(2),
.pricing-table th:nth-child(2) {
  text-align: center;
  white-space: nowrap;
}

.pricing-table input {
  width: 82px;
  min-height: 38px;
  text-align: center;
}

.line-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.animation-summary {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--soft-blue);
}

.animation-summary {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.animation-summary span {
  color: var(--muted);
  font-weight: 800;
}

.animation-summary strong {
  font-size: 22px;
}

.animation-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.quote-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

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

.animations-list {
  display: grid;
  gap: 14px;
}

.animation-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.animation-card h3 {
  margin-bottom: 4px;
}

.animation-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed #b9c6d8;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
}

.totals-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid #bdd2f0;
  border-radius: 8px;
  background: #bdd2f0;
}

.totals-box div {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  background: #f8fbff;
}

.totals-box div:nth-child(3) {
  background: var(--soft-blue);
}

.totals-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.totals-box strong {
  align-self: start;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.05;
}

.totals-box small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

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

.offer-logo {
  width: 150px;
  height: auto;
}

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

.offer-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.offer-animation {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.offer-animation-heading {
  display: grid;
  gap: 4px;
}

.animation-number {
  margin: 0;
  color: var(--magenta);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.offer-animation h3 {
  margin: 0;
  font-size: 24px;
}

.offer-animation h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

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

.compact-meta {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.offer-meta p {
  margin: 0;
}

.offer-table {
  margin-top: 12px;
}

.materials-list {
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--soft-mint);
}

.materials-list ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.materials-list li {
  font-weight: 750;
}

.specification-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.offer-table th:nth-child(2),
.offer-table th:nth-child(3),
.offer-table th:nth-child(4),
.offer-table td:nth-child(2),
.offer-table td:nth-child(3),
.offer-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.offer-table tfoot td {
  border-bottom: 0;
  font-weight: 900;
}

.add-next-button {
  justify-self: end;
}

.offer-download-actions {
  display: flex;
  justify-content: end;
  margin-top: 18px;
}

.add-next-button,
.offer-download-actions .secondary-button {
  min-width: 220px;
}

.screen-only {
  display: initial;
}

.client-code-status {
  margin-top: 14px;
  color: var(--muted);
}

.totals-box div:nth-child(3) {
  background: linear-gradient(135deg, #fff0f9, var(--soft-blue));
}

.pdf-preview-section {
  overflow: hidden;
}

.pdf-stage {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8eaef;
}

.pdf-paper {
  width: min(794px, 100%);
  min-height: 1123px;
  margin: 0 auto;
  padding: 42px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 16px 44px rgba(29, 29, 31, 0.16);
}

.pdf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 4px solid transparent;
  border-image: var(--brand-gradient) 1;
}

.pdf-header img {
  width: 150px;
  height: auto;
}

.pdf-header p,
.pdf-header span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
  text-transform: uppercase;
}

.pdf-header h2 {
  margin: 4px 0;
  font-size: 26px;
  text-align: right;
}

.pdf-client,
.pdf-animation,
.pdf-summary {
  margin-top: 22px;
}

.pdf-client h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.pdf-client div,
.pdf-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pdf-client p,
.pdf-meta p {
  margin: 0;
  font-size: 12px;
}

.pdf-meta p {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
}

.pdf-meta span {
  font-weight: 800;
  text-align: left;
}

.pdf-animation {
  break-inside: avoid;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pdf-animation-title {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.pdf-animation-title span {
  color: var(--magenta);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pdf-animation-title strong {
  font-size: 20px;
}

.pdf-materials {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  background: #f4f6f9;
  font-size: 12px;
}

.pdf-materials ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.pdf-table {
  margin-top: 12px;
  font-size: 12px;
}

.pdf-table th,
.pdf-table td {
  padding: 8px 6px;
}

.pdf-table th:nth-child(2),
.pdf-table th:nth-child(3),
.pdf-table th:nth-child(4),
.pdf-table td:nth-child(2),
.pdf-table td:nth-child(3),
.pdf-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.pdf-table tfoot td {
  font-weight: 900;
}

.pdf-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #cfd7e5;
  border-radius: 6px;
  background: #cfd7e5;
  break-inside: avoid;
}

.pdf-summary div {
  display: grid;
  grid-template-rows: 18px 34px 16px;
  align-content: start;
  gap: 6px;
  min-height: 78px;
  padding: 12px;
  background: #fff;
}

.pdf-summary div:nth-child(3) {
  background: var(--soft-blue);
}

.pdf-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.pdf-summary strong {
  align-self: start;
  display: block;
  min-height: 34px;
  font-size: 17px;
  line-height: 34px;
}

.pdf-summary small {
  display: block;
  min-height: 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 16px;
}

.pdf-empty {
  margin-top: 24px;
  padding: 16px;
  border: 1px dashed #b9c6d8;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 860px) {
  .topbar,
  .split-heading,
  .quote-action,
  .offer-header,
  .animation-card {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    display: none;
  }

  .grid.two,
  .grid.three,
  .builder-layout,
  .offer-meta,
  .totals-box,
  .pdf-client div,
  .pdf-meta,
  .pdf-summary {
    grid-template-columns: 1fr;
  }

  .inline-action {
    grid-template-columns: 1fr;
  }

  .animation-card {
    grid-template-columns: 1fr;
  }

  .pdf-paper {
    width: 100%;
    min-height: auto;
    padding: 22px;
  }

  .pdf-header {
    display: grid;
  }

  .pdf-header p,
  .pdf-header span,
  .pdf-header h2 {
    text-align: left;
  }
}

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

  .topbar,
  .quote-form,
  .list-section,
  .offer-panel,
  .pdf-preview-section .section-heading,
  .offer-download-actions,
  .screen-only {
    display: none !important;
  }

  main,
  .pdf-preview-section,
  .pdf-paper {
    width: 100%;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .pdf-stage {
    padding: 0;
    border: 0;
    background: #fff;
  }
}
