:root {
  --accent: #a4161a;
  --surface: #f5f3f4;
  --ink: #161a1d;
  --muted: #161a1d;
  --line: #d3d3d3;
  --white: #ffffff;
  --shadow: 0 22px 65px rgba(22, 26, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--white);
  font-family: "DM Sans", sans-serif;
}

button,
input {
  font: inherit;
}

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

.hero {
  position: relative;
  min-height: 350px;
  padding: 36px 0 56px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--accent);
  font-family: "Fraunces", serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.brand-logo {
  display: block;
  width: 120px;
  height: auto;
  object-fit: contain;
}

.hero-copy {
  grid-column: 1 / -1;
  max-width: 730px;
  padding-top: 62px;
}

.eyebrow,
.step-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

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

h1 {
  margin-bottom: 20px;
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-size: clamp(2.8rem, 6vw, 5.35rem);
  line-height: 0.97;
  letter-spacing: -0.045em;
}

.intro {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

.freshness-note {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(164, 22, 26, 0.14);
}

.calculator-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, 0.75fr);
  min-height: 720px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.calculator-panel {
  padding: 50px 54px;
}

.quote-panel {
  display: flex;
  flex-direction: column;
  padding: 50px 42px 40px;
  color: var(--white);
  background: var(--accent);
}

.quote-panel .step-label.light,
.quote-panel .live-badge,
.quote-panel .quote-service > span,
.quote-panel .quote-service small,
.quote-panel .quote-math span,
.quote-panel .quote-math small,
.quote-panel .total-row span,
.quote-panel .quote-note {
  color: var(--white);
}

.quote-panel .math-symbol {
  color: var(--white) !important;
}

.quote-panel .live-badge span {
  background: var(--white);
}

.quote-panel .quote-service,
.quote-panel .quote-math {
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.quote-panel .primary-button {
  color: var(--accent);
  background: var(--white);
}

.quote-panel .secondary-button {
  color: var(--white);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.6);
}

.panel-heading,
.quote-topline,
.rate-table-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.required-note {
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 26px;
}

.service-card {
  position: relative;
  min-height: 206px;
  padding: 26px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(22, 26, 29, 0.08);
}

.service-card.is-selected {
  border-color: var(--accent);
  background: rgba(164, 22, 26, 0.06);
  box-shadow: inset 0 0 0 1px var(--accent);
}

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

.radio-ui {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
}

.is-selected .radio-ui {
  border: 6px solid var(--accent);
}

.service-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 14px;
  color: var(--white);
  background: var(--accent);
}

.service-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.service-copy,
.service-copy > * {
  display: block;
}

.service-copy strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 1rem;
}

.service-copy small {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.76rem;
}

.includes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.includes-list span {
  padding: 5px 8px;
  border-radius: 99px;
  color: var(--accent);
  background: var(--surface);
  font-size: 0.64rem;
  font-weight: 600;
}

.weight-block {
  margin-top: 40px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

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

.weight-input-wrap {
  display: flex;
  max-width: 330px;
  align-items: center;
  border-bottom: 2px solid var(--accent);
}

.weight-input-wrap input {
  width: 100%;
  padding: 0 0 7px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Fraunces", serif;
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
  -moz-appearance: textfield;
}

.weight-input-wrap input::-webkit-outer-spin-button,
.weight-input-wrap input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.weight-input-wrap input.is-invalid {
  color: var(--accent);
}

.weight-input-wrap span {
  align-self: flex-end;
  padding-bottom: 11px;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
}

.field-help,
.field-error {
  margin: 8px 0 0;
  font-size: 0.72rem;
}

.field-help {
  color: var(--muted);
}

.field-error {
  min-height: 18px;
  color: var(--accent);
  font-weight: 600;
}

.rate-table-wrap {
  margin-top: 30px;
  padding: 20px 22px 15px;
  border-radius: 14px;
  background: var(--surface);
}

.rate-table-heading {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.rate-table {
  display: grid;
  gap: 2px;
}

.rate-row {
  display: grid;
  grid-template-columns: 1fr auto 60px;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.rate-row strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.rate-row strong small {
  color: var(--muted);
  font-weight: 500;
}

.rate-row em {
  color: var(--accent);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
}

.rate-row.is-active {
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(22, 26, 29, 0.07);
}

.rate-row.is-active strong,
.rate-row.is-active strong small,
.rate-row.is-active em {
  color: var(--white);
}

.step-label.light {
  color: var(--accent);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 0.68rem;
}

.live-badge span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.quote-service {
  margin-top: 38px;
  padding-bottom: 27px;
  border-bottom: 1px solid var(--line);
}

.quote-service > span,
.quote-math span,
.total-row span {
  display: block;
  color: var(--ink);
  font-size: 0.72rem;
}

.quote-service strong {
  display: block;
  margin-top: 6px;
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
}

.quote-service small {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 0.73rem;
  line-height: 1.5;
}

.quote-math {
  display: grid;
  grid-template-columns: 0.7fr auto 1.3fr;
  gap: 15px;
  align-items: center;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}

.quote-math strong {
  display: block;
  margin-top: 6px;
  font-size: 0.92rem;
}

.quote-math small {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.62rem;
}

.math-symbol {
  color: var(--accent) !important;
  font-family: "Fraunces", serif;
  font-size: 1.2rem !important;
}

.total-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 29px;
}

.total-row strong {
  font-family: "Fraunces", serif;
  font-size: 2.55rem;
  line-height: 1;
  white-space: nowrap;
}

.summary-box {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}

.summary-box p {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-box pre {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 0.68rem;
  line-height: 1.52;
  white-space: pre-wrap;
}

.primary-button,
.secondary-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, filter 150ms ease, background 150ms ease;
}

.primary-button {
  margin-top: 16px;
  color: var(--white);
  background: var(--accent);
}

.secondary-button {
  margin-top: 9px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.secondary-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.primary-button[aria-disabled="true"],
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.quote-note {
  margin: auto 0 0;
  padding-top: 20px;
  color: var(--ink);
  font-size: 0.62rem;
  line-height: 1.5;
  text-align: center;
}

.quote-panel.has-error .quote-math,
.quote-panel.has-error .total-row,
.quote-panel.has-error .summary-box {
  opacity: 0.35;
}

.process-note {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 54px 10px 70px;
}

.process-note > div {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.note-number {
  color: var(--accent);
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.process-note p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.process-note strong {
  color: var(--accent);
  font-size: 0.8rem;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 13px 18px;
  border-radius: 10px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 12px 35px rgba(22, 26, 29, 0.25);
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero {
    min-height: 330px;
  }

  .calculator-shell {
    grid-template-columns: 1fr;
  }

  .quote-panel {
    min-height: 690px;
  }

  .freshness-note {
    bottom: 45px;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    min-height: 360px;
    padding-top: 22px;
  }

  .hero-copy {
    padding-top: 58px;
  }

  .freshness-note {
    right: auto;
    bottom: 35px;
    left: 0;
  }

  .calculator-shell {
    border-radius: 18px;
  }

  .calculator-panel,
  .quote-panel {
    padding: 36px 22px;
  }

  .service-grid,
  .process-note {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 180px;
  }

  .rate-table-heading span:last-child {
    display: none;
  }

  .rate-row {
    grid-template-columns: 1fr auto;
  }

  .rate-row em {
    grid-column: 1 / -1;
    padding-bottom: 7px;
    text-align: left;
  }

  .quote-panel {
    min-height: 730px;
  }

  .total-row strong {
    font-size: 2.15rem;
  }

  .process-note {
    gap: 22px;
    padding-inline: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
