/*
 * GPAT — Réservation d'équipement sans compte ([gpat-rental]).
 * Réplique le design du booking flow de l'app (préfixe .bf-* → .gpat-rental-*).
 * Tout est scopé sous .gpat-rental / .gpat-rental-overlay pour ne pas fuir dans le thème.
 */

/* ── Bouton déclencheur ─────────────────────────────────────────────────── */
.gpat-rental,
.gpat-rental * {
  box-sizing: border-box;
}

.gpat-rental {
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.gpat-rental-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: #005876;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(0, 88, 118, 0.25);
}

.gpat-rental-trigger:hover {
  background: #004560;
  box-shadow: 0 6px 18px rgba(0, 88, 118, 0.35);
}

/* ── Overlay + modal ────────────────────────────────────────────────────── */
body.gpat-rental-open {
  overflow: hidden;
}

.gpat-rental-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100000;
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #111827;
  line-height: 1.4;
  animation: gpat-rental-fade 0.18s ease;
}

.gpat-rental-overlay *,
.gpat-rental-overlay *::before,
.gpat-rental-overlay *::after {
  box-sizing: border-box;
}

@keyframes gpat-rental-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gpat-rental-modal {
  background: #fff;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.gpat-rental-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #eef1f4;
}

.gpat-rental-h {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

.gpat-rental-x {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gpat-rental-x:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.gpat-rental-body {
  padding: 16px 20px 24px;
}

/* Icônes inline */
.gpat-rental-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.gpat-rental-ico svg {
  width: 1em;
  height: 1em;
  display: block;
}

/* ── Carte équipement sélectionné (entête) ──────────────────────────────── */
.gpat-rental-hcard {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #eef1f4;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.gpat-rental-hcard-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #edf0f3;
  background: #f4f7fa;
}

.gpat-rental-hcard-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gpat-rental-hcard-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #005876 0%, #2563eb 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.gpat-rental-hcard-info {
  min-width: 0;
  flex: 1;
}

.gpat-rental-hcard-title {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  margin-bottom: 4px;
}

.gpat-rental-hcard-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gpat-rental-hcard-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #005876;
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

.gpat-rental-hcard-loc .gpat-rental-ico { font-size: 14px; }

/* ── Stepper ────────────────────────────────────────────────────────────── */
.gpat-rental-steps {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 0 4px;
}

.gpat-rental-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 40px;
  flex-shrink: 0;
}

.gpat-rental-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s;
}

.gpat-rental-step-label {
  font-size: 9px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.25s;
}

.gpat-rental-step.active .gpat-rental-step-num {
  background: #005876;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 88, 118, 0.35);
}

.gpat-rental-step.active .gpat-rental-step-label { color: #005876; }

.gpat-rental-step.completed .gpat-rental-step-num {
  background: #059669;
  color: #fff;
}

.gpat-rental-step.completed .gpat-rental-step-label { color: #059669; }

.gpat-rental-step-line {
  flex: 1;
  height: 3px;
  min-width: 6px;
  background: #e5e7eb;
  border-radius: 2px;
  margin: 14.5px 2px 0;
  transition: background 0.25s;
}

.gpat-rental-step-line.active { background: #059669; }

/* ── Contenu ────────────────────────────────────────────────────────────── */
.gpat-rental-content {
  animation: gpat-rental-slide 0.2s ease;
}

@keyframes gpat-rental-slide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.gpat-rental-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 14px;
}

.gpat-rental-section-label .gpat-rental-ico {
  font-size: 20px;
  color: #005876;
}

.gpat-rental-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #005876;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 14px;
  cursor: pointer;
}

.gpat-rental-back .gpat-rental-ico { font-size: 16px; }
.gpat-rental-back:hover { text-decoration: underline; }

.gpat-rental-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f4f8;
  color: #005876;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.gpat-rental-date-badge .gpat-rental-ico { font-size: 14px; }

.gpat-rental-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}

.gpat-rental-hint .gpat-rental-ico { font-size: 16px; flex-shrink: 0; }

/* ── Calendrier ─────────────────────────────────────────────────────────── */
.gpat-rental-cal {
  background: #fff;
  border: 1px solid #eef1f4;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.gpat-rental-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gpat-rental-cal-nav button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gpat-rental-cal-nav button:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.gpat-rental-cal-month {
  font-weight: 700;
  font-size: 16px;
  color: #111827;
  text-transform: capitalize;
}

.gpat-rental-cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.gpat-rental-cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.gpat-rental-cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}

.gpat-rental-cal-cell:hover:not(.past):not(.other):not(.beyond-limit):not(.no-slots):not(.full) {
  background: #e8f4f8;
  color: #005876;
}

.gpat-rental-cal-cell.selected {
  background: #005876;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 88, 118, 0.3);
}

.gpat-rental-cal-cell.past,
.gpat-rental-cal-cell.other,
.gpat-rental-cal-cell.no-slots,
.gpat-rental-cal-cell.beyond-limit {
  color: #d1d5db;
  cursor: default;
}

.gpat-rental-cal-cell.full {
  color: #f4a0a0;
  background: #fef2f2;
  cursor: default;
}

.gpat-rental-cal-cell:disabled {
  cursor: default;
}

/* ── Créneaux ───────────────────────────────────────────────────────────── */
.gpat-rental-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gpat-rental-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.gpat-rental-slot:hover:not(.unavailable) {
  border-color: #005876;
  background: #f0f7fa;
  box-shadow: 0 4px 12px rgba(0, 88, 118, 0.1);
}

.gpat-rental-slot.unavailable {
  opacity: 0.5;
  cursor: default;
  background: #f9fafb;
}

.gpat-rental-slot-time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: #111827;
}

.gpat-rental-slot-time .gpat-rental-ico {
  font-size: 18px;
  color: #005876;
}

.gpat-rental-slot-avail {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  padding: 4px 10px;
  border-radius: 999px;
}

.gpat-rental-slot-avail.unavailable {
  background: #fee2e2;
  color: #dc2626;
}

/* ── Grille équipements ─────────────────────────────────────────────────── */
.gpat-rental-eq-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gpat-rental-eq-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #eef1f4;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.gpat-rental-eq-card:hover { box-shadow: 0 10px 26px rgba(0, 0, 0, 0.07); }
.gpat-rental-eq-card:active { transform: scale(0.985); }

.gpat-rental-eq-icon {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #eef1f4;
  background: #f4f7fa;
}

.gpat-rental-eq-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gpat-rental-eq-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f4f8;
  color: #005876;
  font-size: 24px;
  font-weight: 800;
}

.gpat-rental-eq-content {
  min-width: 0;
  flex: 1;
}

.gpat-rental-eq-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  line-height: 1.15;
  margin-bottom: 4px;
}

.gpat-rental-eq-desc {
  margin: 0 0 6px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gpat-rental-eq-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #005876;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.gpat-rental-eq-loc .gpat-rental-ico { font-size: 14px; }

.gpat-rental-eq-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #005876;
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
}

.gpat-rental-eq-btn .gpat-rental-ico { font-size: 14px; }

/* ── Formulaire ─────────────────────────────────────────────────────────── */
.gpat-rental-form {
  background: #fff;
  border: 1px solid #eef1f4;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.gpat-rental-field {
  margin-bottom: 12px;
}

.gpat-rental-field:last-child { margin-bottom: 0; }

.gpat-rental-field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.gpat-rental-field-row {
  display: flex;
  gap: 12px;
}

.gpat-rental-field-row .gpat-rental-field {
  flex: 1;
}

.gpat-rental-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  color: #111827;
}

.gpat-rental-input::placeholder { color: #9ca3af; }

.gpat-rental-input:focus {
  outline: none;
  border-color: #005876;
}

.gpat-rental-textarea {
  resize: vertical;
  min-height: 64px;
}

/* Honeypot : retiré du flux, invisible, mais soumis si un bot le remplit. */
.gpat-rental-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Récapitulatif ──────────────────────────────────────────────────────── */
.gpat-rental-recap {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.gpat-rental-recap-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.gpat-rental-recap-row:last-child { border-bottom: none; }

.gpat-rental-recap-label {
  color: #6b7280;
  font-weight: 500;
  flex-shrink: 0;
}

.gpat-rental-recap-value {
  color: #111827;
  font-weight: 600;
  text-align: right;
}

/* ── Bouton principal ───────────────────────────────────────────────────── */
.gpat-rental-btn {
  width: 100%;
  padding: 14px 20px;
  background: #005876;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(0, 88, 118, 0.25);
}

.gpat-rental-btn .gpat-rental-ico { font-size: 18px; }

.gpat-rental-btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.gpat-rental-btn:hover:not(:disabled) {
  background: #004560;
  box-shadow: 0 6px 18px rgba(0, 88, 118, 0.35);
}

.gpat-rental-btn.confirm {
  background: #059669;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.gpat-rental-btn.confirm:hover:not(:disabled) {
  background: #047857;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4);
}

/* ── État succès ────────────────────────────────────────────────────────── */
.gpat-rental-done {
  text-align: center;
  padding-top: 12px;
}

.gpat-rental-done-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.gpat-rental-done-icon .gpat-rental-ico {
  font-size: 48px;
  color: #059669;
}

.gpat-rental-done-title {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px;
}

.gpat-rental-done-sub {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px;
  line-height: 1.4;
}

.gpat-rental-done-details {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.gpat-rental-done-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
}

.gpat-rental-done-row:last-child { border-bottom: none; }

.gpat-rental-done-row .gpat-rental-ico {
  font-size: 18px;
  color: #005876;
  flex-shrink: 0;
}

/* ── Loading / Empty / Error ────────────────────────────────────────────── */
.gpat-rental-loading,
.gpat-rental-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
}

.gpat-rental-empty .gpat-rental-ico {
  font-size: 32px;
  color: #005876;
  opacity: 0.6;
}

.gpat-rental-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fee2e2;
  color: #dc2626;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}

.gpat-rental-error .gpat-rental-ico { font-size: 18px; flex-shrink: 0; }

.gpat-rental-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #d1d5db;
  border-top-color: #005876;
  border-radius: 50%;
  animation: gpat-rental-spin 0.7s linear infinite;
}

.gpat-rental-spinner.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-top-color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
}

@keyframes gpat-rental-spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .gpat-rental-body { padding: 14px 14px 20px; }
  .gpat-rental-step { width: 32px; }
  .gpat-rental-step-num { width: 28px; height: 28px; font-size: 12px; }
  .gpat-rental-step-label { font-size: 8px; }
  .gpat-rental-step-line { margin-top: 12.5px; }
  .gpat-rental-field-row { flex-direction: column; gap: 0; }
  .gpat-rental-field-row .gpat-rental-field { margin-bottom: 12px; }
}
