/* ==========================================================
   BONJOUR PICKLEBALL - NEW LIEU / CONTRIBUTION SURFACE
   Scope:
   - public "Nouveau lieu" flow
   - shared contribution blocks reused on single-lieu
   Doctrine:
   - owns bp-new-lieu-* and practice-selector styles
   - complements site-wide-ui.css, does not redefine global tokens
   - mobile-first
   ========================================================== */

.bp-new-lieu-box {
  padding: 0.9rem;
  border-radius: 18px;
  background: var(--bp-white);
  border: 1px solid var(--bp-border-ann);
  box-shadow: var(--shadow-panel);
}

.bp-new-lieu-box--accordion > summary {
  list-style: none;
  cursor: pointer;
}

.bp-new-lieu-box--accordion > summary::-webkit-details-marker {
  display: none;
}

.bp-new-lieu-box--accordion > summary::marker {
  content: "";
}

.bp-new-lieu-box__summary {
  display: block;
}

.bp-new-lieu-box__summary .bp-new-lieu-box__head {
  position: relative;
  padding-right: 38px;
}

.bp-new-lieu-box__summary .bp-new-lieu-box__head::after {
  content: "+";
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--bp-border-ann);
  background: var(--bp-info-bg);
  color: var(--bp-navy);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

.bp-new-lieu-box--accordion[open] .bp-new-lieu-box__summary .bp-new-lieu-box__head::after {
  content: "–";
}

/* Accordéons <details class="bp-card"> dans les formulaires lieu */
details.bp-card:hover {
  transform: none;
}

details.bp-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bp-text);
  padding: 0;
}

details.bp-card > summary::-webkit-details-marker {
  display: none;
}

details.bp-card > summary::marker {
  content: "";
}

details.bp-card > summary::after {
  content: "+";
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--bp-border-ann);
  background: var(--bp-info-bg);
  color: var(--bp-navy);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

details.bp-card[open] > summary::after {
  content: "–";
}

details.bp-card > summary + * {
  margin-top: 0.75rem;
}

.bp-new-lieu-box__panel {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.bp-new-lieu-box__head {
  display: grid;
  gap: 6px;
}

.bp-new-lieu-box__head h2 {
  margin: 0;
  color: var(--bp-text);
  line-height: 1.15;
  font-size: 1.02rem;
}

.bp-new-lieu-box__lead {
  margin: 0;
  color: var(--bp-text-muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.bp-new-lieu-form__section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 0.9rem;
}

.bp-new-lieu-form__section-copy {
  display: grid;
  gap: 4px;
}

.bp-new-lieu-form__eyebrow {
  margin: 0;
  color: var(--bp-navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bp-new-lieu-form__section-title {
  margin: 0;
  color: var(--bp-text);
  font-size: 1.02rem;
  line-height: 1.2;
}

.bp-new-lieu-form__section-note,
.bp-new-lieu-form__closing-note {
  margin: 0;
  color: var(--bp-text-soft);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.bp-new-lieu-form__micro-note {
  display: block;
  margin-top: 0.18rem;
  color: var(--bp-navy);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
}

.bp-new-lieu-form__field > .bp-new-lieu-form__micro-note + input[type="file"] {
  margin-top: 0.3rem;
}

.bp-new-lieu-form__field > .bp-help,
.bp-new-lieu-practice-fieldset > .bp-help,
.bp-crowd-fieldset > .bp-help {
  display: block;
  margin-top: 0.32rem;
  max-width: 62ch;
  color: var(--bp-text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.bp-new-lieu-form__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bp-info-bg);
  border: 1px solid var(--bp-border-ann-mid);
  color: var(--bp-navy);
  font-size: var(--text-xs);
  font-weight: 800;
  white-space: nowrap;
}

.bp-new-lieu-form .bp-field--invalid input,
.bp-new-lieu-form .bp-field--invalid textarea,
.bp-new-lieu-form .bp-field--invalid select {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.08);
}

.bp-new-lieu-form .bp-field--invalid label,
.bp-new-lieu-form .bp-form-consent--invalid label,
.bp-new-lieu-form .bp-field--invalid legend {
  color: #b91c1c;
}

.bp-new-lieu-form .bp-form-consent--invalid {
  padding: 0.75rem 0.85rem;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
}

.bp-new-lieu-form__grid.bp-form-grid--2cols {
  align-items: start;
}

.bp-new-lieu-form__inline-error {
  display: block;
  margin-top: 0.45rem;
  color: #b91c1c;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

.bp-new-lieu-form__geo-note {
  margin: -0.25rem 0 0.2rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--bp-text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.bp-new-lieu-form__geo-note.is-success {
  border-color: #86efac;
  background: #ecfdf3;
  color: #166534;
}

.bp-new-lieu-form__geo-note.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.bp-new-lieu-form__city-suggestions {
  display: grid;
  gap: 8px;
  margin: -0.05rem 0 0.35rem;
}

.bp-new-lieu-form__city-suggestions-title {
  margin: 0;
  color: var(--bp-text-soft);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
}

.bp-new-lieu-form__city-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bp-new-lieu-form__city-suggestion {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--bp-border-brand);
  border-radius: 999px;
  background: #fff8f1;
  color: var(--bp-brand-dark);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.bp-new-lieu-form__city-suggestion:hover,
.bp-new-lieu-form__city-suggestion:focus-visible {
  border-color: var(--bp-brand);
  background: #fff1e6;
  color: var(--bp-brand-strong);
}

.bp-new-lieu-form__submit-note {
  margin: 0.6rem 0 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.bp-new-lieu-form__submit-note--error {
  color: #b91c1c;
  font-weight: 700;
}

.bp-new-lieu-box__status {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  font-size: 0.96rem;
  line-height: 1.45;
  scroll-margin-top: 110px;
}

.bp-new-lieu-box__status-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.bp-new-lieu-box__status-title::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #fff;
  font-size: 0.96rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.22);
  flex: 0 0 auto;
}

.bp-new-lieu-box__status-copy {
  display: block;
}

.bp-new-lieu-box__status:focus,
.bp-new-lieu-box__status:focus-visible {
  outline-offset: 3px;
}

.bp-new-lieu-box__status--success {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.16), transparent 36%),
    linear-gradient(180deg, #f7fff8 0%, #ecfdf3 100%);
  border: 1px solid #86efac;
  color: #166534;
  box-shadow:
    0 14px 34px rgba(180, 83, 9, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  animation: bp-success-reveal 0.34s ease both;
}

.bp-new-lieu-box__status--success:focus,
.bp-new-lieu-box__status--success:focus-visible {
  outline: 2px solid #22c55e;
  box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.3);
}

.bp-new-lieu-box__status--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.bp-new-lieu-box__status--error:focus,
.bp-new-lieu-box__status--error:focus-visible {
  outline: 2px solid #dc2626;
  box-shadow: 0 0 0 3px rgba(254, 202, 202, 0.45);
}

@keyframes bp-success-reveal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bp-crowd-fieldset,
.bp-new-lieu-practice-fieldset {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.55rem;
}

.bp-new-lieu-practice-fieldset legend {
  margin: 0;
  color: var(--bp-text-secondary);
  font-size: var(--text-xs);
  font-weight: 800;
  font-style: normal;
}

/* Dans la liste à cocher (canaux, niveaux), les items ne doivent pas s'empiler dans grid-area "check" */
.bp-new-lieu-practice-list > .bp-new-lieu-practice-check {
  grid-area: auto;
}

.bp-new-lieu-practice-grid {
  display: grid;
  gap: 0.55rem;
}

.bp-new-lieu-practice-type {
  grid-area: check;
  display: grid;
  gap: 0.26rem;
  align-content: start;
}

.bp-new-lieu-practice-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.48rem;
  align-items: start;
}

.bp-new-lieu-practice-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  grid-template-areas:
    "check count"
    "surface surface";
  gap: 0.5rem;
  align-items: stretch;
}

.bp-new-lieu-practice-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 42px;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--bp-border-soft);
  border-radius: 12px;
  background: #fff;
  color: var(--bp-text);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.bp-new-lieu-practice-count,
.bp-new-lieu-practice-surface {
  display: grid;
  gap: 0.26rem;
  align-content: start;
}

.bp-new-lieu-practice-count {
  grid-area: count;
}

.bp-new-lieu-practice-surface {
  grid-area: surface;
}

.bp-new-lieu-practice-count-label {
  color: var(--bp-text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.bp-new-lieu-practice-option input[type="number"],
.bp-new-lieu-practice-option input[type="text"],
.bp-crowd-fieldset textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.7rem 0.52rem;
  border: 1px solid var(--bp-border-soft);
  border-radius: 12px;
  background: #fff;
  color: var(--bp-text);
  font: inherit;
}

.bp-new-lieu-practice-option input[type="number"] {
  text-align: center;
  font-weight: 700;
}

.bp-new-lieu-practice-check input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  border: initial;
  border-radius: initial;
  background: initial;
  box-shadow: none;
  margin: 0;
  accent-color: var(--bp-brand);
}

.bp-new-lieu-form__field > .bp-new-lieu-practice-list {
  margin-top: 0.2rem;
}

@supports selector(:has(*)) {
  .bp-new-lieu-practice-check:has(input:checked) {
    border-color: var(--bp-brand);
    background: #fff4ea;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--bp-brand) 28%, transparent);
  }
}

@media (min-width: 641px) {
  .bp-new-lieu-practice-grid {
    gap: 0.65rem;
  }

  .bp-new-lieu-practice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .bp-new-lieu-practice-option {
    grid-template-columns: minmax(0, 0.7fr) 120px minmax(90px, 1.44fr);
    grid-template-areas: "check count surface";
    gap: 0.6rem;
  }


  .bp-new-lieu-practice-check {
    min-height: 44px;
    padding: 0.72rem 0.8rem;
    font-size: 0.93rem;
  }

  .bp-new-lieu-practice-option input[type="number"],
  .bp-new-lieu-practice-option input[type="text"] {
    min-height: 44px;
    padding-inline: 0.8rem;
  }
}

@media (min-width: 768px) {
  .bp-new-lieu-box {
    padding: 1rem;
    border-radius: 16px;
  }

  .bp-new-lieu-form__section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
  }
}

@media (prefers-color-scheme: dark) {
  .bp-new-lieu-box {
    background: var(--bp-surface);
    border-color: var(--bp-border-soft);
    box-shadow: var(--shadow-card);
  }

  .bp-new-lieu-box__head h2,
  .bp-new-lieu-form__section-title {
    color: var(--bp-text);
  }

  .bp-new-lieu-box__lead,
  .bp-new-lieu-form__section-note,
  .bp-new-lieu-form__closing-note,
  .bp-new-lieu-form__submit-note {
    color: var(--bp-text-secondary);
  }

  .bp-new-lieu-form__eyebrow,
  .bp-new-lieu-form__pill,
  .bp-new-lieu-form__micro-note {
    color: var(--bp-link);
  }

  .bp-new-lieu-form__pill {
    background: color-mix(in srgb, var(--bp-info-bg) 72%, transparent);
    border-color: color-mix(in srgb, var(--bp-border-ann-mid) 58%, transparent);
  }

  .bp-new-lieu-form__geo-note {
    border-color: color-mix(in srgb, #334155 34%, transparent);
    background: color-mix(in srgb, #0f172a 30%, transparent);
    color: #e2e8f0;
  }

  .bp-new-lieu-form__geo-note.is-success {
    border-color: color-mix(in srgb, #86efac 55%, transparent);
    background: color-mix(in srgb, #14532d 28%, transparent);
    color: #dcfce7;
  }

  .bp-new-lieu-form__geo-note.is-error {
    border-color: color-mix(in srgb, #fecaca 55%, transparent);
    background: color-mix(in srgb, #7f1d1d 28%, transparent);
    color: #fee2e2;
  }

  .bp-new-lieu-form__city-suggestion {
    background: color-mix(in srgb, var(--bp-info-bg) 72%, transparent);
    border-color: color-mix(in srgb, var(--bp-border-brand) 62%, transparent);
    color: var(--bp-link);
  }

  .bp-new-lieu-form__city-suggestion:hover,
  .bp-new-lieu-form__city-suggestion:focus-visible {
    border-color: var(--bp-link);
    color: var(--bp-link-dark);
  }

  .bp-new-lieu-box__status--success {
    background: var(--bp-success-bg);
    border-color: color-mix(in srgb, var(--bp-success) 45%, transparent);
    color: var(--bp-success);
  }

  .bp-new-lieu-box__status--error {
    background: var(--bp-error-bg);
    border-color: color-mix(in srgb, var(--bp-error) 45%, transparent);
    color: var(--bp-error);
  }

  .bp-new-lieu-form__submit-note--error {
    color: var(--bp-error);
  }

  .bp-new-lieu-practice-option input[type="number"],
  .bp-new-lieu-practice-option input[type="text"],
  .bp-crowd-fieldset textarea {
    background: var(--bp-surface-soft);
    color: var(--bp-text);
    border-color: var(--bp-border-soft);
    color-scheme: dark;
  }

  .bp-new-lieu-practice-check {
    background: var(--bp-surface-soft);
    border-color: var(--bp-border-soft);
    color: var(--bp-text);
  }
}
