/* QuoteLawn customer quote flow — page styles. REBUILT 2026-11-16.
   Shared colours/fonts come from theme.css. Layout, step indicator, service
   cards and quote summary follow the old widget (March 2026 upload and the
   Aug 2026 index.html fragments); the payment UI from the old widget is gone
   on purpose — no money moves through this flow. */

:root { --dark2: #142214; --mid: #2A3F2A; --shadow: 0 8px 32px rgba(0,0,0,.35); }
body { min-height: 100vh; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(45,106,45,.28) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 100%, rgba(139,195,74,.08) 0%, transparent 50%); }
.widget-container { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 24px 16px 40px; }

/* Embedded (iframe) mode: full-bleed. The host page sizes the iframe (fixed
   1500/1800px), so nothing here may depend on the viewport height. */
body.embedded { min-height: 0; }
body.embedded::before { display: none; }
body.embedded .widget-container { max-width: 100%; padding: 16px 12px; }
@media (max-width: 520px) { body.embedded .widget-container { padding: 12px 8px; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Header: provider identity (or generic before one is known) ── */
.widget-header { text-align: center; margin-bottom: 24px; }
.widget-header h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; color: #fff; text-transform: uppercase; margin: 0; }
.widget-header h1 span { color: var(--lime); }
.widget-header .sub { margin: 8px 0 0; color: var(--text-dim); font-size: 15px; }
.provider-id { display: none; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 14px; }
.widget-header.has-provider .provider-id { display: flex; }
.pi-name { font-family: var(--font-head); font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
.pi-stars { font-size: 14px; color: var(--text-dim); }
.pi-stars .st { color: var(--gold); letter-spacing: 2px; font-size: 16px; }
.pi-logo { display: block; border: 2px solid rgba(139,195,74,.4); }
.initials { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid rgba(139,195,74,.4); color: var(--text); font: 700 24px var(--font-head); letter-spacing: .04em; }
.initials.rect { width: 96px; height: 52px; border-radius: 8px; }

/* ── Step indicator ── */
.steps { display: flex; justify-content: center; align-items: center; margin: 0 0 22px; padding: 0; list-style: none; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.step.active { color: var(--lime); }
.step.done { color: #66BB6A; }
.step-num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid currentColor; display: flex; align-items: center; justify-content: center; font: 700 13px var(--font-head); flex-shrink: 0; }
.step.active .step-num { background: var(--lime); border-color: var(--lime); color: var(--bg); }
.step.done .step-num { background: #66BB6A; border-color: #66BB6A; color: var(--bg); }
.step-line { width: 28px; height: 2px; background: var(--border); margin: 0 4px; }

/* ── Cards, titles, buttons ── */
.card { margin-bottom: 16px; box-shadow: var(--shadow); }
.card-title { font-family: var(--font-head); font-size: 19px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--lime); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.btn-row { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; }
.btn-row .btn-primary { margin-left: auto; }
.btn-primary, .btn { min-height: 48px; }
.btn-primary.big { width: 100%; font-size: 18px; min-height: 54px; }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--lime); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; min-height: 44px; }

.screen { display: none; }
.screen.active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen.active { animation: none; } }

.field { margin-bottom: 12px; }
.field input, .field select, .field textarea { min-height: 48px; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.address-row { display: flex; gap: 10px; align-items: flex-end; }
.address-row .field { flex: 1; margin: 0; }
.help { font-size: 13px; color: var(--text-dim); margin: 6px 0 0; }
.form-err { color: var(--danger); font-size: 14px; margin: 8px 0 0; min-height: 0; }
.form-err:empty { display: none; }

.notice { border-radius: 8px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; line-height: 1.5; }
.notice.gold { background: rgba(249,168,37,.1); border: 1px solid rgba(249,168,37,.3); color: var(--gold); }
.notice.green { background: rgba(45,106,45,.18); border: 1px solid rgba(139,195,74,.3); color: var(--text); }
.notice.red { background: rgba(239,83,80,.1); border: 1px solid rgba(239,83,80,.35); color: #ffb4b2; }

/* Google Places dropdown (lives on <body>, styled to match) */
.pac-container { background: var(--dark2) !important; border: 1px solid var(--border) !important; border-radius: 8px !important; box-shadow: var(--shadow) !important; font-family: var(--font) !important; margin-top: 4px !important; z-index: 10000 !important; }
.pac-item { padding: 10px 14px !important; color: var(--text-dim) !important; cursor: pointer !important; border-top: 1px solid var(--border) !important; font-size: 14px !important; line-height: 1.6 !important; }
.pac-item:hover, .pac-item-selected { background: var(--mid) !important; }
.pac-item-query { color: var(--text) !important; font-size: 15px !important; }
.pac-icon { display: none !important; }
.pac-matched { color: var(--lime) !important; }

/* ── Map step ── */
.map-status { background: var(--dark2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--lime); margin-bottom: 10px; }
.map-status .sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.map-status.error { color: #ffb4b2; border-color: rgba(239,83,80,.35); }
.map-status.success { color: #A5D6A7; border-color: rgba(129,199,132,.35); }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(139,195,74,.2); border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
.map-status:not(.busy) .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.map-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.map-btn { background: var(--dark2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 12px; min-height: 44px; font: 600 14px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.map-btn:hover { border-color: var(--lime); }
.map-btn[aria-pressed="true"] { background: var(--lime); color: var(--bg); border-color: var(--lime); }
.map-btn.cut[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); }
.map-btn:disabled { opacity: .45; cursor: not-allowed; }

.map-wrap { position: relative; width: 100%; }
#map { width: 100%; height: 420px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #0b140b; }
#drawCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: none; z-index: 5; border-radius: 10px; }
#drawCanvas.on { display: block; cursor: crosshair; }
.draw-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; background: rgba(15,26,15,.88); color: var(--text); font-size: 13px; padding: 6px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.map-legend { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -2px; margin-right: 5px; }

.sqft-display { display: flex; align-items: center; gap: 16px; background: var(--dark2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-top: 12px; flex-wrap: wrap; }
.sqft-display .num { font: 800 30px/1 var(--font-head); color: var(--lime); }
.sqft-display .lbl { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.sqft-display .hint { font-size: 13px; color: var(--text-dim); margin-left: auto; text-align: right; line-height: 1.4; }
.manual-sqft { margin-top: 12px; }

/* Mobile: the map step takes over the screen so the map is big enough to
   draw on with a finger (recovered layout note: on mobile #mapCard goes
   position:fixed inset:0). */
@media (max-width: 640px) {
  body.map-active { overflow: hidden; }
  body.map-active #mapCard { position: fixed; inset: 0; z-index: 50; margin: 0; border-radius: 0; border: 0;
    display: flex; flex-direction: column; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); overflow-y: auto; }
  body.map-active #mapCard .card-title { font-size: 16px; margin-bottom: 8px; }
  body.map-active #mapCard .map-wrap { flex: 1 1 auto; min-height: 260px; }
  body.map-active #map { height: 100%; min-height: 260px; }
  body.map-active #mapCard .btn-row { margin-top: 10px; }
  body.map-active .sqft-display { margin-top: 8px; padding: 8px 12px; }
  body.map-active .sqft-display .num { font-size: 24px; }
  .map-btn { padding: 8px 10px; font-size: 13px; }
}
/* Embedded mode: undo the mobile fullscreen-takeover for #mapCard. Inside a
   fixed-height iframe, position:fixed would size to the 1800px iframe, not
   the phone screen, and the host page owns scrolling. */
@media (max-width: 640px) {
  body.embedded.map-active { overflow: visible; }
  body.embedded #mapCard { position: static; inset: auto; z-index: auto; display: block; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; }
  body.embedded #map { height: 460px; min-height: 0; }
  body.embedded .map-wrap { flex: none; min-height: 0; }
}

/* ── Services step ── */
.provider-list { display: grid; gap: 10px; }
.provider-opt { display: flex; align-items: center; gap: 12px; background: var(--dark2); border: 2px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; text-align: left; color: var(--text); font: inherit; width: 100%; min-height: 64px; }
.provider-opt:hover { border-color: rgba(139,195,74,.5); }
.provider-opt[aria-pressed="true"] { border-color: var(--lime); background: rgba(139,195,74,.08); }
.provider-opt .nm { font-weight: 700; }
.provider-opt .meta { font-size: 13px; color: var(--text-dim); }
.provider-opt .initials { width: 44px; height: 44px; font-size: 17px; }
.provider-opt img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.service-card { background: var(--dark2); border: 2px solid var(--border); border-radius: 10px; padding: 14px; position: relative; }
.service-card.selected { border-color: var(--lime); background: rgba(139,195,74,.07); }
.svc-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 0; color: var(--text); font-size: 16px; }
.svc-toggle input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--lime); }
.service-icon { font-size: 22px; line-height: 1; }
.service-name { font-weight: 700; }
.service-price { font: 700 18px var(--font-head); color: var(--lime); margin-top: 2px; }
.service-price small { font: 500 12px var(--font); color: var(--text-dim); }
.svc-opts { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: none; }
.service-card.selected .svc-opts { display: block; }
.svc-opts fieldset { border: 0; margin: 0 0 10px; padding: 0; }
.svc-opts legend { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; padding: 0; }
.opt-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin: 0 0 6px; cursor: pointer; min-height: 32px; }
.opt-line input { width: 20px; height: 20px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: var(--lime); }
.opt-line .amt { margin-left: auto; color: var(--lime); font-weight: 600; white-space: nowrap; }
.empty { color: var(--text-dim); text-align: center; padding: 18px 8px; }

/* ── Quote step ── */
.quote-summary { background: linear-gradient(135deg, var(--dark2), var(--mid)); border: 1px solid rgba(139,195,74,.25); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.quote-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.quote-row:last-child { border-bottom: 0; }
.quote-row .label { color: var(--text-dim); }
.quote-row .value { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.quote-row.sub .label { padding-left: 14px; }
.quote-total { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 14px; padding-top: 14px; border-top: 2px solid rgba(139,195,74,.3); gap: 12px; }
.quote-total .label { font: 700 18px var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.quote-total .amount { font: 800 38px/1 var(--font-head); color: var(--lime); }
.quote-total .per { font-size: 12px; color: var(--text-dim); text-align: right; }
.payment-callout { border: 2px solid rgba(139,195,74,.45); background: rgba(139,195,74,.08); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px; color: var(--text); }
.payment-callout strong { display: block; font: 700 13px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--lime); margin-bottom: 2px; }
.terms-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-dim); margin: 6px 0 12px; }
.terms-row input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--lime); }
.terms-row label { margin: 0; font-size: 14px; }
.share-box { display: flex; gap: 8px; margin-top: 10px; }
.share-box input { flex: 1; min-width: 0; }

/* ── Success ── */
.success-screen { text-align: center; padding: 32px 18px; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(139,195,74,.15); border: 2px solid var(--lime); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 32px; color: var(--lime); }
.success-screen h2 { font-size: 32px; font-weight: 800; text-transform: uppercase; color: var(--lime); }
.success-screen p { color: var(--text-dim); max-width: 440px; margin: 0 auto 8px; }
.order-ref { display: inline-block; background: var(--dark2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 20px; font: 700 22px var(--font-head); color: var(--lime); letter-spacing: .1em; margin: 14px 0; }

/* ── Modals (knockdown, treatment acknowledgment) ── */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.65); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; max-width: 440px; width: 100%; box-shadow: var(--shadow); }
.modal h2 { font-size: 24px; color: var(--text); }
.modal p { color: var(--text-dim); font-size: 15px; }
.modal .fee { font-size: 16px; color: var(--lime); font-weight: 700; margin: 0 0 16px; }
.modal .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.modal .btns > * { flex: 1 1 150px; white-space: normal; line-height: 1.3; }
/* In an iframe the overlay is as tall as the iframe; keep the dialog near the top. */
body.embedded .modal-overlay { align-items: flex-start; padding-top: 80px; }

.powered { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 18px; }
.powered a { color: var(--text-dim); }

@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .address-row { flex-direction: column; align-items: stretch; }
  .step > span { display: none; }
  .step-line { width: 16px; }
  .services-grid { grid-template-columns: 1fr; }
  .quote-total .amount { font-size: 32px; }
  .btn-row > * { flex: 1 1 auto; }
}
