:root {
  color-scheme: light;
  --ink: #10263f;
  --muted: #607086;
  --paper: #f6f8fb;
  --white: #ffffff;
  --line: #dbe2ea;
  --accent: #e6903c;
  --accent-dark: #b75c1d;
  --sky: #dceef2;
  --success: #16705a;
  --danger: #a93c3c;
  --shadow: 0 18px 55px rgba(16, 38, 63, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 15% 0%, #eaf4f5 0, transparent 30rem), var(--paper); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.masthead { min-height: 74px; padding: 12px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 1.25rem; letter-spacing: -.02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }
.brand-logo { width: 55px; height: 55px; display: block; border-radius: 50%; object-fit: cover; }
.brand-mark { width: 40px; height: 40px; padding: 6px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); transform: rotate(-3deg); }
.brand-mark span { width: 100%; height: 100%; display: block; border: 3px solid var(--accent); box-shadow: inset 0 0 0 2px #fff; }
.secure-note { color: var(--muted); font-size: .88rem; }
main { width: min(100% - 32px, 1020px); margin: 0 auto; padding: 54px 0 80px; }
.intro { max-width: 680px; margin: 0 auto 34px; text-align: center; }
.eyebrow { margin: 0 0 9px; color: var(--accent-dark); font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
h1 { margin-bottom: 14px; font-size: clamp(2.1rem, 5vw, 3.65rem); line-height: 1.02; }
.intro > p:last-child { margin: 0; color: var(--muted); font-size: 1.06rem; line-height: 1.65; }
.stepper { max-width: 620px; margin: 0 auto 28px; display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; }
.step { appearance: none; border: 0; padding: 6px; display: flex; align-items: center; gap: 8px; background: transparent; color: var(--muted); font-size: .86rem; font-weight: 700; }
.step span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--white); }
.step.is-active { color: var(--ink); }
.step.is-active span { border-color: var(--ink); background: var(--ink); color: white; }
.step-line { height: 1px; background: var(--line); }
.form-step { padding: clamp(24px, 5vw, 52px); border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.panel-heading { margin-bottom: 32px; display: flex; gap: 16px; align-items: flex-start; }
.panel-heading h2 { margin-bottom: 5px; font-size: clamp(1.7rem, 3vw, 2.25rem); }
.panel-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.section-number { flex: 0 0 auto; padding-top: 5px; color: var(--accent-dark); font-weight: 800; font-size: .78rem; letter-spacing: .12em; }
.field-grid { display: grid; gap: 20px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }
label, legend { color: var(--ink); font-size: .92rem; font-weight: 750; }
input, textarea { width: 100%; margin-top: 8px; border: 1px solid #bfcbd7; border-radius: 9px; background: #fff; color: var(--ink); padding: 13px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(230,144,60,.18); }
input:user-invalid, textarea:user-invalid { border-color: var(--danger); }
.choice-group { margin: 30px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice-group legend { margin-bottom: 12px; grid-column: 1/-1; }
.choice-card { padding: 15px; display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--accent); background: #fff8ef; box-shadow: inset 0 0 0 1px var(--accent); }
.choice-card input { width: auto; margin: 3px 0 0; accent-color: var(--accent-dark); }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 3px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.shipping-fields { margin-top: 22px; padding: 22px; border-radius: 14px; background: #f1f5f8; }
.quantity-row { margin-bottom: 24px; padding: 18px; display: grid; grid-template-columns: minmax(180px, .65fr) 1fr; gap: 22px; align-items: end; border-radius: 14px; background: var(--sky); }
.quantity-row label small { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; font-weight: 500; }
.quantity-row input[readonly] { background: #f8fafb; color: var(--ink); font-weight: 800; }
.price-badge { text-align: right; }
.price-badge small, .price-badge span { display: block; color: var(--muted); font-size: .78rem; }
.price-badge strong { display: block; margin: 2px 0; font-family: Georgia, serif; font-size: 1.8rem; }
.dropzone { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 5px; border: 2px dashed #9eb4c2; border-radius: 16px; background: #f9fbfc; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--accent-dark); background: #fff9f2; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone span { color: var(--muted); font-weight: 500; }
.upload-icon { width: 42px; height: 42px; margin-bottom: 4px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white !important; font-size: 1.5rem; }
.field-error { min-height: 1.2em; margin: 8px 0 0; color: var(--danger); font-size: .86rem; font-weight: 650; }
.field-error.is-valid { color: #26734d; }
.photo-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.photo-card { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.image-guidance { margin: 18px 0 0; padding: 16px 18px; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; background: #fff8ef; }
.image-guidance h3 { margin: 0 0 6px; font-family: inherit; font-size: .95rem; letter-spacing: 0; }
.image-guidance p { margin: 4px 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.image-guidance strong { color: var(--ink); }
.crop-guide-key { margin: 12px 0 0; padding: 13px 15px; border-radius: 10px; background: #f2f6f8; color: var(--muted); font-size: .83rem; line-height: 1.45; }
.crop-guide-key strong { color: var(--ink); }
.guide-swatch { width: 20px; height: 12px; margin: 0 5px 0 12px; display: inline-block; vertical-align: -2px; border: 2px solid rgba(255,255,255,.95); background: #607086; }
.guide-swatch.safe { border-style: dashed; border-color: #f7b955; }
.mockup { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border: 2px solid #c7b99d; border-radius: 3px; background: #fff; box-shadow: 0 8px 20px rgba(16,38,63,.14); cursor: grab; touch-action: none; user-select: none; }
.mockup.is-positioning { cursor: grabbing; }
.mockup.vertical { width: 68%; margin-inline: auto; aspect-ratio: 2 / 3; }
.mockup img { position: absolute; display: block; max-width: none; object-fit: fill; }
.mockup::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 18px rgba(16,38,63,.2); pointer-events: none; }
.finished-guide, .safe-guide { position: absolute; pointer-events: none; }
.finished-guide { inset: 0; border: 2px solid rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(16,38,63,.32), inset 0 0 0 1px rgba(16,38,63,.25); }
.safe-guide { inset: 6.25% 4.1667%; border: 2px dashed #f7b955; box-shadow: 0 0 0 1px rgba(16,38,63,.18); }
.mockup.vertical .finished-guide { inset: 0; }
.mockup.vertical .safe-guide { inset: 4.1667% 6.25%; }
.finished-guide span, .safe-guide span { position: absolute; left: 5px; padding: 2px 5px; border-radius: 4px; color: #fff; background: rgba(16,38,63,.78); font-size: .62rem; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.finished-guide span { top: 5px; }
.safe-guide span { bottom: 5px; background: rgba(122,75,12,.88); }
.fit-result { margin-top: 11px; padding: 10px 11px; border-radius: 9px; display: grid; gap: 3px; background: #edf7f2; color: var(--success); }
.fit-result strong { font-size: .82rem; }
.fit-result span { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.fit-check .fit-result { background: #fff5df; color: #8b5a10; }
.fit-warning .fit-result { background: #fdecec; color: var(--danger); }
.photo-meta { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; }
.orientation-toggle { display: inline-flex; flex: 0 0 auto; padding: 3px; gap: 2px; border-radius: 8px; background: #eef2f5; }
.orientation-toggle button { border: 0; border-radius: 6px; padding: 7px 9px; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 750; }
.orientation-toggle button.is-active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(16,38,63,.14); }
.best-fit-note { margin: 10px 0 0; color: #26734d; font-size: .76rem; font-weight: 750; }
.use-best-fit { margin-top: 10px; border: 1px solid #b9c8d3; border-radius: 7px; padding: 7px 10px; background: #f7fafb; color: var(--ink); font-size: .75rem; font-weight: 750; }
.use-best-fit:hover { border-color: var(--accent-dark); background: #fff9f2; }
.scale-control { margin-top: 13px; display: grid; gap: 7px; padding: 11px 12px; border-radius: 10px; background: #f4f7f9; }
.scale-control > span { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-size: .8rem; font-weight: 800; }
.scale-control output { color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.scale-control input[type="range"] { width: 100%; min-height: 24px; margin: 0; padding: 0; accent-color: var(--accent-dark); cursor: ew-resize; }
.scale-control small { color: var(--muted); font-size: .72rem; font-weight: 500; line-height: 1.4; }
.position-controls { margin: 10px 0 0; padding: 10px 12px 12px; display: grid; gap: 8px; border: 0; border-radius: 10px; background: #f4f7f9; }
.position-controls legend { padding: 0; color: var(--ink); font-size: .8rem; font-weight: 800; }
.position-controls label { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.position-controls input[type="range"] { width: 100%; min-height: 24px; margin: 0; padding: 0; accent-color: var(--accent-dark); }
.position-controls small { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.photo-quantity { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: .82rem; }
.photo-quantity input { width: 92px; padding: 9px 10px; text-align: center; font-weight: 800; }
.remove-photo { margin-top: 10px; border: 0; padding: 0; background: transparent; color: var(--danger); font-size: .78rem; font-weight: 700; }
.confirmation-check { margin-top: 24px; display: flex; gap: 11px; align-items: flex-start; line-height: 1.5; font-weight: 550; }
.confirmation-check input { width: auto; margin: 4px 0 0; accent-color: var(--accent-dark); }
.subscription-check { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .86rem; line-height: 1.45; font-weight: 550; }
.subscription-check input { width: auto; margin: 3px 0 0; accent-color: var(--accent-dark); }
.actions { margin-top: 34px; padding-top: 22px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.primary, .secondary { min-height: 46px; border-radius: 9px; padding: 11px 18px; font-weight: 800; }
.primary { border: 1px solid var(--ink); background: var(--ink); color: white; box-shadow: 0 7px 14px rgba(16,38,63,.16); }
.primary:hover { background: #183957; }
.primary:disabled { opacity: .6; cursor: wait; }
.secondary { border: 1px solid #aebdca; background: white; color: var(--ink); }
.review-layout { display: grid; grid-template-columns: 1fr minmax(290px, .68fr); gap: 24px; align-items: start; }
.review-card { margin-bottom: 22px; padding: 20px; border-radius: 14px; background: #f2f5f7; }
.review-card p { margin: 0 0 7px; color: var(--muted); line-height: 1.45; }
.review-card p:last-child { margin: 0; }
.review-card strong { color: var(--ink); }
.optional { color: var(--muted); font-size: .78rem; font-weight: 500; }
.totals-card { padding: 22px; border-radius: 16px; background: var(--ink); color: white; }
.totals-card h3 { margin-bottom: 18px; font-size: 1.35rem; }
.totals-card dl { margin: 0; }
.totals-card dl div { padding: 9px 0; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
.totals-card dt { color: #cbd5df; }
.totals-card dd { margin: 0; font-weight: 750; }
.totals-card .total { margin-top: 7px; padding-top: 16px; border-bottom: 0; font-size: 1.08rem; }
.totals-card .total dt, .totals-card .total dd { color: white; }
.totals-card p { margin: 18px 0 0; color: #b9c7d4; font-size: .82rem; line-height: 1.5; }
.submit-error { margin-top: 22px; padding: 14px; border-radius: 10px; background: #fdecec; color: var(--danger); font-weight: 650; }
.success { max-width: 680px; margin: 24px auto 0; padding: clamp(32px, 6vw, 64px); border: 1px solid var(--line); border-radius: 22px; background: white; text-align: center; box-shadow: var(--shadow); }
.success-mark { width: 58px; height: 58px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: #e6f4ef; color: var(--success); font-size: 1.6rem; font-weight: 900; }
.success h2 { margin-bottom: 12px; font-size: 2.2rem; }
.success > p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.order-number { width: fit-content; margin: 26px auto; padding: 14px 24px; border-radius: 10px; background: var(--paper); }
.order-number small, .order-number strong { display: block; }
.order-number small { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }
.order-number strong { margin-top: 4px; font-size: 1.1rem; }
footer { width: min(100% - 32px, 1020px); margin: 0 auto; padding: 24px 0 36px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

@media (max-width: 720px) {
  .secure-note { display: none; }
  main { padding-top: 36px; }
  .step { flex-direction: column; gap: 4px; font-size: .72rem; }
  .field-grid.two, .choice-group, .quantity-row, .photo-grid, .review-layout { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .price-badge { text-align: left; }
  .photo-grid { gap: 14px; }
  .mockup.vertical { width: 58%; }
  footer { display: block; text-align: center; }
  footer span { display: block; margin: 4px; }
}

@media (prefers-reduced-motion: no-preference) {
  .form-step.is-active, .success:not([hidden]) { animation: reveal .28s ease-out; }
  @keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
