/* ==========================================================================
   Screen 5 — Farm Plot GPS Registration
   ========================================================================== */

/* ---- Satellite map ------------------------------------------------------ */

.map-card {
  display: flex;
  flex-direction: column;
}

.map {
  position: relative;
  flex: 1;
  min-height: 400px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(118deg, transparent 46.6%, rgba(255, 255, 255, 0.75) 47%, rgba(255, 255, 255, 0.75) 48.4%, transparent 48.8%),
    linear-gradient(12deg, transparent 72%, rgba(144, 202, 249, 0.55) 72.4%, rgba(144, 202, 249, 0.55) 74.6%, transparent 75%),
    radial-gradient(260px 190px at 16% 20%, rgba(139, 195, 74, 0.45), transparent 70%),
    radial-gradient(320px 220px at 88% 84%, rgba(104, 159, 56, 0.42), transparent 70%),
    radial-gradient(220px 170px at 80% 14%, rgba(205, 220, 57, 0.32), transparent 70%),
    radial-gradient(240px 180px at 10% 90%, rgba(161, 136, 127, 0.28), transparent 70%),
    linear-gradient(160deg, #eef7e6 0%, #dcedc8 45%, #c5e1a5 100%);
}

.map__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(46, 125, 50, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 125, 50, 0.13) 1px, transparent 1px);
  background-size: 36px 36px;
}

.map__plot {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 46%;
  height: 44%;
  border: 3px solid #2e7d32;
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0 10px, rgba(76, 175, 80, 0.18) 10px 20px);
  box-shadow: 0 0 0 8px rgba(46, 125, 50, 0.14), 0 24px 44px -22px rgba(27, 94, 32, 0.7);
  transform: translate(-50%, -50%) rotate(-3deg);
}

.map__pin {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 40px;
  line-height: 1;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.3));
  animation: pin-drop 900ms var(--ease-out) both 300ms;
}

/* Pulse ring under the pin tip */
.map__pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 22px;
  height: 10px;
  margin-left: -11px;
  border-radius: 50%;
  background: rgba(198, 40, 40, 0.35);
  animation: pin-pulse 2.2s var(--ease-out) infinite;
}

@keyframes pin-drop {
  from { opacity: 0; transform: translate(-50%, -160%); }
  to   { opacity: 1; transform: translate(-50%, -100%); }
}

@keyframes pin-pulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; }
}

.map__label {
  position: absolute;
  left: 50%;
  top: calc(50% + 14px);
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  color: #1b5e20;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(46, 125, 50, 0.25);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}

.map__controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
}

.map__btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-700);
  transition: background var(--dur-fast);
}

.map__btn + .map__btn {
  border-top: 1px solid var(--line);
}

.map__btn:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.map__source {
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--ink-600);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
}

/* ---- GPS capture bar ---------------------------------------------------- */

.gps {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(90deg, var(--accent-soft), var(--surface) 70%);
  border-top: 1px solid var(--accent-line);
}

.gps__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  font-size: 22px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--accent-line), 0 8px 18px -10px var(--accent-glow);
}

.gps__info {
  flex: 1;
  min-width: 0;
}

.gps__coords {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--accent-ink);
}

.gps__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-500);
}

.gps__sub::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.18);
}

.gps__btn {
  min-height: 42px;
  padding: 8px 16px;
  font-size: var(--fs-sm);
  border-radius: 12px;
}

/* ---- Plot details form -------------------------------------------------- */

.form-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
}

.form-card .field__hint {
  margin-top: -2px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
}

.variety-chips {
  margin-top: 2px;
  gap: 8px;
}

.variety-chips .chip {
  min-height: 36px;
  padding: 6px 14px;
}

/* Sits at the foot of the (stretched) form card */
.offline-tag {
  align-items: center;
  margin-top: auto;
}

/* ---- TraceX note -------------------------------------------------------- */

.trace-note {
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(320px 160px at 100% 0%, rgba(144, 202, 249, 0.35), transparent 70%),
    var(--tone-soft);
}

.trace-note .callout__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 24px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--tone-line), 0 10px 22px -12px rgba(13, 71, 161, 0.5);
}

.trace-note .callout__body {
  font-size: var(--fs-base);
  line-height: 1.75;
}

.plot-id {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  color: var(--accent-ink);
}

@media (max-width: 600px) {
  .map {
    min-height: 300px;
  }

  .map__plot {
    width: 64%;
  }

  .gps {
    flex-wrap: wrap;
    padding: 16px;
  }

  .gps__btn {
    width: 100%;
  }

  .trace-note {
    flex-direction: column;
    align-items: flex-start;
  }
}
