/* Mobile-first, designed at 390px. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #e63946;
  --brand-dark: #c1121f;
  --ink: #1d2433;
  --muted: #6b7280;
  --bg: #ffffff;
  --line: #e5e7eb;
  --green: #16a34a;
  --radius: 14px;
}
html, body { height: 100%; }
body {
  font-family: "Helvetica Neue", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; min-height: 100dvh; padding: 28px 22px; flex-direction: column; max-width: 480px; margin: 0 auto; }
.screen.active { display: flex; }
.screen-map { padding: 0; max-width: none; position: relative; }

h1 { font-size: 26px; line-height: 1.25; margin-bottom: 12px; }
h2 { font-size: 19px; margin: 22px 0 12px; }
.muted { color: var(--muted); font-size: 15px; line-height: 1.5; }
.hidden { display: none !important; }
.error { color: var(--brand-dark); font-size: 14px; margin: 8px 0; }

.intro-art, .thanks-art { font-size: 56px; text-align: center; margin: 26px 0 18px; }

.btn-primary, .btn-secondary {
  display: block; width: 100%; padding: 16px; margin-top: 18px;
  font-size: 17px; font-weight: 700; border-radius: var(--radius);
  border: none; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .55; }
.btn-secondary { background: #f3f4f6; color: var(--ink); }
.btn-secondary:disabled { opacity: .5; }

.phone-row {
  display: flex; align-items: center; border: 2px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-top: 6px;
}
.phone-row:focus-within { border-color: var(--brand); }
.phone-prefix { padding: 14px 4px 14px 14px; font-size: 18px; font-weight: 600; color: var(--muted); }
#phone-input { flex: 1; border: none; outline: none; font-size: 18px; padding: 14px 14px 14px 6px; letter-spacing: 1px; }

.code-input {
  width: 100%; border: 2px solid var(--line); border-radius: var(--radius);
  font-size: 34px; letter-spacing: 16px; text-align: center; padding: 14px;
  outline: none; margin-top: 8px;
}
.code-input:focus { border-color: var(--brand); }

/* ---- map screen ---- */
#map { position: absolute; inset: 0; background: #eceae4; }
.map-top { position: absolute; top: 14px; left: 14px; right: 14px; z-index: 20; }
.search-wrap { position: relative; }
#search-input {
  width: 100%; padding: 14px 16px; font-size: 16px; border: none;
  border-radius: var(--radius); box-shadow: 0 2px 12px rgba(0,0,0,.18);
  outline: none; font-family: inherit; -webkit-appearance: none;
}
.search-results {
  position: absolute; top: 54px; left: 0; right: 0; background: #fff;
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.18);
  overflow: hidden; max-height: 40dvh; overflow-y: auto;
}
.search-results div { padding: 13px 16px; font-size: 15px; border-bottom: 1px solid var(--line); cursor: pointer; }
.search-results div:last-child { border-bottom: none; }
.search-results div:active { background: #f3f4f6; }

.btn-gps {
  position: absolute; right: 14px; bottom: 110px; z-index: 20;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.2);
  font-size: 26px; color: var(--ink); cursor: pointer;
}
.map-hint {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  background: rgba(29,36,51,.88); color: #fff; padding: 10px 18px;
  border-radius: 22px; font-size: 14px; z-index: 15; white-space: nowrap;
}

/* bottom sheet */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.22); padding: 10px 22px 30px;
  transform: translateY(110%); transition: transform .28s ease;
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 44px; height: 4px; background: var(--line); border-radius: 2px; margin: 4px auto 14px; }
.sheet-address { font-size: 17px; font-weight: 700; line-height: 1.35; }
.sheet-progress, .thanks-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.bar { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar.big { height: 12px; border-radius: 6px; }
.bar-fill { height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width .4s ease; }
.count { font-size: 15px; font-weight: 700; white-space: nowrap; }
.qualified { margin-top: 12px; color: var(--green); font-size: 14px; font-weight: 600; line-height: 1.4; }

.thanks-progress { margin: 18px 0 6px; }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 24px;
  font-size: 15px; z-index: 100; opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
