:root {
  color-scheme: light;
  --navy: #173f5f;
  --navy-dark: #0f2d45;
  --sky: #dceaf2;
  --sky-strong: #aec8d7;
  --paper: #ffffff;
  --canvas: #eef3f6;
  --ink: #1f303b;
  --muted: #687b87;
  --line: #d1dee5;
  --success: #2d765f;
  --danger: #a74242;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(174, 200, 215, 0.42), transparent 28rem),
    var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="file"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(43, 112, 149, 0.24);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--navy);
  border-bottom: 5px solid var(--sky-strong);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-frame {
  display: grid;
  place-items: center;
  width: 184px;
  height: 64px;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
}

.logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.37);
}

.eyebrow {
  margin: 0 0 4px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 2px;
  font-size: clamp(21px, 2.3vw, 30px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.subtitle {
  margin-bottom: 0;
  color: #cfe0ea;
  font-size: 13px;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 12px;
  color: #e9f5f1;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #65d0aa;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(101, 208, 170, 0.14);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(390px, 520px);
  align-items: start;
  gap: 18px;
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.form-panel,
.preview-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(20, 57, 82, 0.09);
}

.form-panel {
  padding: 16px;
}

.progress-card {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
  padding: 13px 15px;
  color: #fff;
  background: var(--navy-dark);
  border-radius: 12px;
}

.progress-card div:first-child {
  display: grid;
  gap: 2px;
}

#progressLabel {
  color: #bed3df;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#progressTitle {
  font-size: 16px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--sky-strong);
  border-radius: inherit;
  transition: width 220ms ease;
}

#quoteForm {
  display: grid;
  gap: 10px;
}

.step-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.step-card.is-active {
  border-color: #8aafc2;
  box-shadow: 0 10px 30px rgba(23, 63, 95, 0.09);
}

.step-card.is-complete {
  border-color: #b8d2c7;
}

.step-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 64px;
  padding: 9px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
}

.step-heading:disabled {
  cursor: default;
  opacity: 0.66;
}

.step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  background: var(--sky);
  border-radius: 10px;
}

.is-active .step-number {
  color: #fff;
  background: var(--navy);
}

.is-complete .step-number {
  color: #fff;
  background: var(--success);
}

.step-heading strong,
.step-heading small {
  display: block;
}

.step-heading strong {
  margin-bottom: 3px;
  font-size: 15px;
}

.step-heading small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.step-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.is-active .step-state {
  color: var(--navy);
}

.is-complete .step-state {
  color: var(--success);
}

.step-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 8px 14px 16px 65px;
  border-top: 1px solid #e4edf2;
}

.step-body[hidden] {
  display: none;
}

.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  color: var(--navy-dark);
  font-size: 12px;
  font-weight: 800;
}

.field-wide {
  grid-column: 1 / -1;
}

.field small,
.image-picker small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bdced8;
  border-radius: 8px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--navy);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
  background: #fffafa;
}

.money-input {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: stretch;
}

.money-input > span {
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--sky);
  border: 1px solid #bdced8;
  border-right: 0;
  border-radius: 8px 0 0 8px;
}

.money-input input {
  border-radius: 0 8px 8px 0;
}

.button,
.icon-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.button:hover,
.icon-button:hover {
  border-color: var(--navy);
}

.button.primary {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

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

.button.secondary {
  color: var(--navy);
  background: var(--sky);
  border-color: #aac3d1;
}

.button.ghost {
  color: var(--navy);
  background: transparent;
}

.step-actions {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
  margin-top: 3px;
}

.step-actions.split {
  justify-content: space-between;
}

.excel-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: #f4f8fa;
  border: 1px dashed #a9c1cf;
  border-radius: 10px;
}

.excel-source p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.excel-actions,
.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-button {
  display: inline-flex;
  align-items: center;
}

.file-button input,
.image-picker > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.image-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 10px;
  background: #f8fbfc;
  border: 1px solid #bdced8;
  border-radius: 9px;
  cursor: pointer;
}

.image-picker img {
  width: 96px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.image-picker > span {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.image-picker .button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}

.total-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(125deg, var(--navy-dark), var(--navy));
  border-radius: 12px;
}

.total-card > span {
  color: #c8dce7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.total-card strong {
  font-size: clamp(26px, 4vw, 38px);
}

.total-card small {
  color: #dce9ef;
  font-weight: 700;
}

.document-actions {
  padding: 12px;
  background: var(--sky);
  border-radius: 10px;
}

.action-status {
  min-height: 18px;
  margin: 0;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.preview-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.preview-header .eyebrow {
  color: var(--navy);
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 36px;
  min-height: 34px;
  padding: 0;
  color: var(--navy);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

#pageIndicator {
  min-width: 92px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

#quoteCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(23, 63, 95, 0.16);
}

.preview-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
    max-width: 620px;
    margin: 0 auto;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    padding: 14px;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .logo-frame {
    width: 154px;
    height: 52px;
  }

  .local-badge {
    font-size: 0;
    padding: 10px;
  }

  .app-shell {
    padding: 10px;
  }

  .form-panel,
  .preview-panel {
    border-radius: 14px;
  }

  .progress-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .step-heading {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .step-state {
    display: none;
  }

  .step-body {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .field-wide {
    grid-column: auto;
  }

  .excel-source {
    align-items: stretch;
    flex-direction: column;
  }

  .excel-actions,
  .document-actions {
    display: grid;
  }

  .excel-actions .button,
  .document-actions .button {
    width: 100%;
  }
}

@media print {
  .site-header,
  .form-panel,
  .preview-header,
  .preview-note {
    display: none !important;
  }

  .app-shell,
  .preview-panel {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  #quoteCanvas {
    width: 8.5in;
    border: 0;
    box-shadow: none;
  }
}
