:root {
  --bg: #f5efe6;
  --surface: #fffaf2;
  --surface-2: #efe6d8;
  --ink: #062f2a;
  --muted: #66736d;
  --line: #ded2c2;
  --green: #062f2a;
  --cream: #f5efe6;
  --cream-2: #fffaf2;
  --shadow: 0 24px 70px rgba(6, 47, 42, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(6, 47, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 47, 42, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 88% 8%, rgba(6, 47, 42, 0.1), transparent 28%),
    linear-gradient(135deg, #f8f1e8 0%, #efe4d5 100%);
  background-size: 40px 40px, 40px 40px, auto, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.quote-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(440px, 1.18fr);
  gap: 20px;
  padding: 18px;
}

.quote-brand,
.quote-card {
  border: 1px solid rgba(6, 47, 42, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.quote-brand {
  position: relative;
  min-height: 0;
  height: calc(100vh - 36px);
  padding: clamp(18px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(rgba(6, 47, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 47, 42, 0.035) 1px, transparent 1px),
    rgba(255, 250, 242, 0.92);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--ink);
}

.quote-brand::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -130px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(6, 47, 42, 0.18);
  border-radius: 50%;
}

.quote-brand img {
  width: min(128px, 38%);
  height: auto;
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quote-brand .eyebrow {
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.quote-brand .eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: #d4c4ac;
}

.quote-brand h1 {
  max-width: 720px;
  margin: 10px 0 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 3.8vw, 52px);
  font-weight: 500;
  line-height: 0.98;
}

.quote-brand p {
  max-width: 620px;
  margin: 0;
  color: #66736d;
  font-size: 14px;
}

.story-panel {
  display: grid;
  gap: 4px;
}

.story-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.story-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.88);
  color: var(--ink);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 900;
}

.brand-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  position: relative;
  z-index: 1;
}

.brand-points span {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.8);
  color: var(--muted);
  font-weight: 900;
  padding: 0 10px;
  font-size: 11px;
}

.brand-points span:first-child {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}

.brand-points strong {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(6, 47, 42, 0.08);
  font-size: 12px;
}

.brand-points span:first-child strong {
  background: rgba(245, 239, 230, 0.15);
}

.quote-card {
  height: calc(100vh - 36px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 250, 242, 0.96);
  overflow: hidden;
}

.quote-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 12px;
}

.quote-topbar h2 {
  margin: 7px 0 0;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.08;
}

#step-count {
  min-width: 58px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.progress-track {
  height: 7px;
  margin: 0 24px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.25s ease;
}

#quote-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.step-body {
  flex: 1;
  padding: 18px 24px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.step-body::-webkit-scrollbar,
.proposal-page::-webkit-scrollbar {
  width: 10px;
}

.step-body::-webkit-scrollbar-thumb,
.proposal-page::-webkit-scrollbar-thumb {
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: rgba(6, 47, 42, 0.28);
}

.helper {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

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

.field {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream-2);
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

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

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

.option-card {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.option-card small {
  color: var(--muted);
}

.option-card.is-selected {
  border-color: var(--green);
  background: #e7efe9;
  box-shadow: inset 0 0 0 1px rgba(6, 47, 42, 0.16);
}

.option-card:disabled,
.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.blocked-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
}

.primary-action,
.secondary-action,
.whatsapp-action {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 900;
}

.primary-action,
.whatsapp-action {
  background: var(--green);
  color: var(--cream);
}

.secondary-action {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.proposal-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 26px;
}

.proposal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

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

.proposal-header h2 {
  margin: 5px 0 4px;
  font-size: 30px;
}

.proposal-header p {
  margin: 0;
  color: var(--muted);
}

.proposal-hero,
.proposal-grid,
.proposal-summary,
.proposal-next {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  margin-bottom: 14px;
}

.proposal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.46fr);
  gap: 16px;
  align-items: center;
  background: var(--green);
  color: var(--cream);
}

.proposal-hero .eyebrow {
  color: rgba(245, 239, 230, 0.76);
}

.proposal-hero h3 {
  margin: 6px 0 0;
  font-size: 32px;
}

.price-box {
  border: 1px solid rgba(245, 239, 230, 0.2);
  border-radius: 12px;
  padding: 16px;
  background: rgba(245, 239, 230, 0.1);
}

.price-box span,
.price-box strong {
  display: block;
}

.price-box strong {
  margin-top: 7px;
  font-size: 25px;
}

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

.proposal-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream-2);
  padding: 14px;
}

.proposal-block h4,
.proposal-summary h4,
.proposal-next h4 {
  margin: 0 0 10px;
}

.proposal-block ul {
  margin: 0;
  padding-left: 18px;
}

.proposal-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.proposal-summary div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--cream-2);
}

.proposal-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.proposal-summary dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.crm-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.crm-status.is-ok {
  color: var(--green);
}

.crm-status.is-error {
  color: #9a433b;
}

.error-note {
  margin-top: 14px;
  color: #9a433b;
  font-weight: 800;
}

@media (max-width: 980px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .quote-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    padding: 16px;
  }

  .quote-brand {
    height: auto;
    min-height: auto;
  }

  .quote-card {
    height: auto;
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .brand-points,
  .field-grid,
  .option-grid,
  .proposal-hero,
  .proposal-grid,
  .proposal-summary dl {
    grid-template-columns: 1fr;
  }

  .quote-topbar,
  .quote-actions,
  .proposal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .quote-actions .primary-action,
  .quote-actions .secondary-action,
  .proposal-actions > * {
    width: 100%;
  }
}

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

  .quote-brand,
  .quote-topbar,
  .progress-track,
  .quote-actions {
    display: none;
  }

  .quote-shell,
  .quote-card {
    display: block;
    min-height: auto;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .proposal-actions {
    display: none;
  }
}
