/* ============================================================
   PAGE: SPOT FORM
   The new/edit form is the showpiece. Three big numbered steps,
   a sticky action bar, and dramatic typography sit on top of
   the .atmosphere--form sky backdrop.
   ============================================================ */

/* ---- Override the existing .spot-header banner on the form pages
   so it merges seamlessly into the sky instead of stamping a gradient
   block ---- */
.atmosphere--form .spot-header {
  background: transparent;
  padding: 5rem 2rem 2rem;
}

.atmosphere--form .spot-header h1 {
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
}

.atmosphere--form .spot-header p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.1rem;
}

.atmosphere--form .spot-header-icon {
  font-size: 3.25rem;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

/* ---- Override the spot-body container on form pages ---- */
.atmosphere--form .spot-body {
  max-width: 760px;
  padding: 1rem 1.25rem 9rem;
  gap: 2rem;
}

/* ---- Step section ---- */
.form-step {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-2xl);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow:
    0 30px 60px -20px rgba(5, 10, 50, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  backdrop-filter: blur(8px);
}

.form-step-head {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

.form-step-num {
  flex-shrink: 0;
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  top: -0.1rem;
}

.form-step-titles {
  flex: 1;
  min-width: 0;
}

.form-step-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--color-dark);
  line-height: 1.05;
}

.form-step-sub {
  margin: 0.3rem 0 0;
  font-size: 0.92rem;
  color: var(--color-gray-500);
  line-height: 1.45;
}

/* ---- The form itself ---- */
.spot-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---- Errors banner (override + lift visually) ---- */
.spot-form .form-errors {
  background: rgba(255, 80, 80, 0.16);
  border: 1px solid rgba(255, 80, 80, 0.4);
  color: #ffd5d5;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.spot-form .form-error-msg {
  color: #fff;
}

/* ---- Step 1: Spot name ---- */
.form-step--name .form-input {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: 1rem 1.1rem;
}

.form-step--name .form-input::placeholder {
  font-weight: 600;
  color: var(--color-gray-400);
}

/* ---- Step 2: Map ---- */
.form-step--map .map-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(5, 10, 50, 0.22);
}

.form-step--map [data-map-target="container"] {
  height: 300px;
}

.form-step--map .leaflet-container {
  border-radius: var(--radius-lg);
}

.form-step--map .coord-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}

.form-step--map .coord-grid .form-input {
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ---- Step 3: Conditions ---- */
.form-step--conditions {
  padding: 1.5rem 1.25rem 1.25rem;
}

@media (min-width: 600px) {
  .form-step--conditions {
    padding: 1.75rem;
  }
}

/* ---- Sticky action bar (desktop only) ---- */
.spot-form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  margin: 1rem -0.5rem -0.5rem;
  background: rgba(11, 20, 82, 0.72);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  z-index: 20;
}

.spot-form-actions .btn-primary {
  flex: 1 1 auto;
  justify-content: center;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
}

.spot-form-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.16);
  color: white;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.spot-form-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.26);
}

.spot-form-actions::before {
  content: '🎈';
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

@media (max-width: 767px) {
  .spot-form-actions {
    position: static;
    background: rgba(11, 20, 82, 0.55);
  }
}

/* iOS safe-area support */
@supports (padding: max(0px)) {
  .spot-form-actions {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* ---- Step pulse on focus-within (subtle live glow) ---- */
.form-step:focus-within {
  box-shadow:
    0 30px 60px -20px rgba(5, 10, 50, 0.55),
    0 0 0 2px var(--color-accent),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

@media (prefers-reduced-motion: reduce) {
  .form-step,
  .form-step:focus-within {
    transition: none;
  }
}
