/* AgroAI — Quick start (interactive first-run walkthrough).
   The page shell, buttons, controls card and status line all come from
   styles.css, exactly as on My Field (en/fields.html) in draw mode. This file
   adds only what the tour needs: the stepper, corner targets, demo pointer,
   wait list and result card. Zone colours are Okabe–Ito, as on insights. */
:root {
  --z-critical: #D55E00; --z-dry: #E69F00; --z-ok: #009E73; --z-wet: #0072B2;
  --action-bg: #FDF3EC; --action-line: #F0C9A8;
}
[hidden] { display: none !important; }
.num { font-family: var(--font-head); font-variant-numeric: tabular-nums; }

/* The demo map is locked to the field: plain cursor, no dragging. */
.mapframe #map { cursor: default; }
.mapframe #map.leaflet-container { background: #27302A; }

/* ── corner targets (overlay above the map) ───────────────
   Pointer events pass straight through to the map so leaflet-geoman draws the
   real vertex; these only show WHERE to click (and carry keyboard focus). */
#dots { position: absolute; inset: 0; z-index: 550; pointer-events: none; }
#dots button {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0;
  border: 0; background: none; border-radius: 50%; cursor: default; pointer-events: none;
  display: grid; place-items: center; color: transparent;
}
#dots button i { display: block; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; border: 2px solid rgba(22, 33, 26, .45); transition: width .12s, height .12s, background .12s; }
#dots button.pending i { opacity: .5; }
#dots button.done i { width: 13px; height: 13px; background: var(--accent); border-color: #FFFFFF; opacity: 1; }
#dots button.off { opacity: 0; }
#dots button.next i { width: 22px; height: 22px; background: var(--z-dry); border-color: #FFFFFF; box-shadow: 0 0 0 4px rgba(230, 159, 0, .35); animation: pulse 1.5s ease-in-out infinite; }
#dots button.next.hover i, #dots button.next:focus-visible i { width: 32px; height: 32px; }
#dots button.next:focus-visible { outline: 3px solid #FFFFFF; outline-offset: -4px; border-radius: 50%; }
#dots button.bounce i { animation: bounce .45s ease; }

/* ── the click-by-click demo pointer ─────────────────────── */
#tour { position: fixed; left: 0; top: 0; z-index: 1200; pointer-events: none; transition: transform .85s var(--ease, cubic-bezier(.22,.61,.36,1)); }
#tour svg { position: absolute; left: -3px; top: -2px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); }
#tour .ripple { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid #FFFFFF; opacity: 0; }
#tour.tap .ripple { animation: ripple .48s ease-out; }
@keyframes ripple { from { transform: scale(.4); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
#tour.still { transition: none; }
#tour.still svg { transform: rotate(-20deg) translate(10px, 10px); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(230, 159, 0, .35); } 50% { box-shadow: 0 0 0 13px rgba(230, 159, 0, 0); } }
@keyframes bounce { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.6); } 70% { transform: scale(.9); } }

/* zone labels on the map — same as the insights page */
.zl { background: none; border: 0; }
.zl span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transform: translate(-50%, -50%); position: absolute;
  background: #fff; color: var(--text); border-radius: 999px; padding: 7px 12px; font: 600 14px/1 var(--font-body); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.zl i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.zl em { font-style: normal; font-family: var(--font-head); font-weight: 700; }

/* How-to hint floating at the top of the map — the same chrome as My Field's
   map day label (.map-daylabel), stretched across the map. */
.map-hint {
  position: absolute; top: 10px; left: 16px; right: 16px; z-index: 600; margin: 0;
  background: rgba(255, 255, 255, 0.97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--accent-line);
  box-shadow: var(--shadow-chrome), var(--glass-edge);
  font-size: 13.5px; line-height: 1.5; color: var(--text); text-align: center;
}
.map-hint strong { color: var(--accent); font-weight: 600; }

/* status line under the card: an optional second line */
.status small { display: block; font-weight: 400; opacity: .85; margin-top: 2px; }

/* ── wait ────────────────────────────────────────────────── */
.qs-h2 { margin: 0 0 var(--s4); font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text); }
.work { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.work li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14.5px; color: var(--muted); }
.work li .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; color: transparent; }
.work li.doing .tick { border-color: var(--z-dry); animation: pulse2 1s ease-in-out infinite; }
.work li.ok .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.work li.ok { color: var(--text); font-weight: 600; }
@keyframes pulse2 { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── result ──────────────────────────────────────────────── */
.qs-result { display: flex; flex-direction: column; gap: var(--s4); }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.total .big { font-size: 38px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin-top: 2px; }
.total .sub { font-size: 13.5px; color: var(--muted); }
.acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.acts li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.acts .n { width: 18px; height: 18px; margin: 0 7px; border-radius: 50%; }
.acts .t { font-weight: 700; font-size: 15px; color: var(--text); }
.acts .m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.acts .amt { text-align: right; }
.acts .amt b { display: block; font-family: var(--font-head); font-size: 17px; color: var(--text); }
.acts li.urgent { border-color: var(--action-line); background: var(--action-bg); }
.note { margin: 0; font-size: 12.5px; color: var(--muted-2); }
.cta { display: grid; gap: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--border); }
.cta a.btn { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  #dots button i, #dots button.next i, #dots button.bounce i, .work li.doing .tick { animation: none !important; transition: none !important; }
  #tour, #tour .ripple { transition: none !important; animation: none !important; }
}
