:root {
  --cream: #fbf5eb;
  --paper: #fffdf8;
  --navy: #123d73;
  --navy-dark: #0b294d;
  --red: #b51e24;
  --gold: #d8b56a;
  --ink: #172235;
  --muted: #667085;
  --border: #ddd5c8;
  --success: #175c3a;
  --error: #9f1d24;
  --shadow: 0 18px 50px rgba(18, 61, 115, .12);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(251,245,235,.94), rgba(251,245,235,.94)),
    url('./assets/seamless-pattern.jpg') center/520px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, select, input, textarea { min-height: 44px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 10px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(18,61,115,.14);
  background: rgba(255,253,248,.96);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 900; line-height: 1.05; text-decoration: none; }
.brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.step-count { min-width: 48px; color: var(--navy); font-weight: 900; text-align: right; }
.offline-banner { padding: 12px 18px; color: #fff; background: var(--red); font-weight: 750; text-align: center; }

.app-shell { width: min(100% - 32px, 900px); margin: 28px auto 110px; }
.pilot-note { margin-bottom: 18px; padding: 12px 16px; border: 1px dashed var(--navy); border-radius: 12px; color: var(--navy); background: #eef5ff; font-weight: 800; }
.progress { height: 6px; margin-bottom: 32px; overflow: hidden; border-radius: 999px; background: #e5ded2; }
.progress-bar { display: block; width: 20%; height: 100%; background: linear-gradient(90deg, var(--navy), var(--red)); transition: width .25s ease; }
.step { padding: clamp(24px, 5vw, 54px); border: 1px solid var(--border); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: var(--red); font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; color: var(--navy-dark); }
h1 { margin: 0; font-size: clamp(2.15rem, 8vw, 4rem); line-height: 1; }
h2 { margin: 0; }
.intro { max-width: 680px; margin: 18px 0 30px; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }

.product-card { display: grid; grid-template-columns: minmax(220px, .75fr) 1.25fr; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: #fff; }
.product-card > img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; background: #f7efe3; }
.product-copy { padding: clamp(22px, 5vw, 40px); }
.product-copy > p { color: var(--muted); line-height: 1.6; }
.product-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.product-heading h2 { font-size: 2rem; }
.product-heading p { margin: 5px 0 0; color: var(--muted); }
.product-heading strong { color: var(--red); font-size: 1.5rem; }
.quantity-row { display: grid; grid-template-columns: 48px 52px 48px; align-items: center; margin-top: 28px; }
.quantity-row button { width: 48px; height: 48px; border: 0; border-radius: 50%; color: #fff; background: var(--navy); font-size: 1.5rem; }
.quantity-row output { font-size: 1.25rem; font-weight: 900; text-align: center; }
.total-card { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 18px 20px; border-radius: 14px; color: #fff; background: var(--navy-dark); font-size: 1.1rem; }

.field { margin-bottom: 22px; }
.field label { display: block; margin-bottom: 8px; color: var(--navy-dark); font-size: .83rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.field label span { color: var(--muted); font-weight: 650; letter-spacing: 0; text-transform: none; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid #bdb5a8; border-radius: 10px; color: var(--ink); background: #fff; }
.field textarea { min-height: 130px; resize: vertical; }
.field-help, .character-count { margin: 7px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.character-count { text-align: right; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.market-details, .confirmation-note { margin: 0 0 22px; padding: 16px; border-left: 4px solid var(--gold); border-radius: 8px; background: #fff7df; line-height: 1.55; }
.global-error { margin-bottom: 20px; padding: 14px 16px; border: 2px solid var(--error); border-radius: 10px; color: var(--error); background: #fff1f1; font-weight: 800; }

.review-card { display: grid; gap: 14px; }
.review-section { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.review-section h2 { margin-bottom: 10px; font-size: 1.2rem; }
.review-section p { margin: 5px 0; line-height: 1.55; }
.confirmation-step { text-align: center; }
.simulation-warning { display: inline-block; margin: 24px 0 8px; padding: 10px 14px; border-radius: 999px; color: #fff; background: var(--red); font-weight: 900; }
.confirmation-step > p:last-of-type { max-width: 650px; margin: 20px auto 28px; font-size: 1.1rem; line-height: 1.7; }

.actions { position: fixed; right: 0; bottom: 0; left: 0; z-index: 9; display: flex; justify-content: center; gap: 12px; padding: 14px max(18px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(255,253,248,.97); backdrop-filter: blur(14px); }
.button { min-height: 46px; padding: 11px 18px; border: 2px solid transparent; border-radius: 10px; font-weight: 900; }
.button-primary { color: #fff; background: var(--red); }
.button-secondary { color: var(--navy); border-color: var(--navy); background: transparent; }
.actions .button { min-width: 132px; }

dialog { width: min(92vw, 520px); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10,27,52,.68); }
.dialog-content { position: relative; padding: 32px; }
.dialog-content p { color: var(--muted); line-height: 1.6; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--navy); background: #f2ece2; font-size: 1.5rem; }

@media (max-width: 680px) {
  .app-header { grid-template-columns: 1fr auto; }
  .brand { grid-column: 1 / -1; }
  .brand img { width: 44px; height: 44px; }
  .install-button { min-width: 120px; }
  .product-card { grid-template-columns: 1fr; }
  .product-card > img { max-height: 260px; min-height: 220px; }
  .form-grid { grid-template-columns: 1fr; }
  .app-shell { width: min(100% - 20px, 900px); margin-top: 18px; }
  .step { padding: 22px 16px; border-radius: 18px; }
  h1 { font-size: clamp(2rem, 12vw, 3rem); }
  .actions .button { flex: 1; min-width: 0; max-width: 220px; }
}

@media (max-width: 340px) {
  .app-header { padding-inline: 10px; }
  .app-shell { width: min(100% - 12px, 900px); }
  .step { padding-inline: 12px; }
  .install-button { min-width: 0; padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
