/* =============================================================================
   France-USA-Net.Com — Bandeau & panneau de consentement cookies
   Style inspiré de tarteaucitron (https://tarteaucitron.io/)
   ============================================================================= */

.fusanet-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(11, 16, 32, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.fusanet-cookie-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Bandeau principal */
.fusanet-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  transform: translateY(110%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0 14px 14px;
  pointer-events: none;
}

.fusanet-cookie-banner.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.fusanet-cookie-banner__inner {
  max-width: 980px;
  margin: 0 auto;
  background: linear-gradient(145deg, #fdfbf8 0%, #ffffff 100%);
  border: 1px solid rgba(44, 95, 78, 0.25);
  border-radius: 14px 14px 4px 4px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.28);
  padding: 22px 24px 20px;
  color: #14110e;
}

.fusanet-cookie-banner__inner::before {
  content: "";
  display: block;
  height: 4px;
  margin: -22px -24px 18px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #002395 0%, #ffffff 50%, #ed2939 100%);
}

.fusanet-cookie-title {
  font-family: var(--font-title, Georgia, serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #2c5f4e;
  margin: 0 0 10px;
}

.fusanet-cookie-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #3d3834;
  margin: 0 0 8px;
}

.fusanet-cookie-highlight {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(44, 95, 78, 0.08);
  border-left: 3px solid #2c5f4e;
  font-size: 0.88rem;
  color: #14110e;
}

.fusanet-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.fusanet-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.fusanet-cookie-btn:hover,
.fusanet-cookie-btn:focus-visible {
  transform: translateY(-1px);
}

.fusanet-cookie-btn--accept {
  background: linear-gradient(135deg, #2c5f4e 0%, #1a3d32 100%);
  color: #f1f5f9;
}

.fusanet-cookie-btn--accept:hover,
.fusanet-cookie-btn--accept:focus-visible {
  background: linear-gradient(135deg, #357a64 0%, #2c5f4e 100%);
}

.fusanet-cookie-btn--refuse {
  background: #ffffff;
  color: #14110e;
  border-color: rgba(44, 95, 78, 0.35);
}

.fusanet-cookie-btn--refuse:hover,
.fusanet-cookie-btn--refuse:focus-visible {
  background: rgba(44, 95, 78, 0.06);
}

.fusanet-cookie-btn--customize {
  background: rgba(244, 213, 138, 0.25);
  color: #7a4a1e;
  border-color: rgba(184, 112, 58, 0.35);
}

.fusanet-cookie-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  color: #1d4ed8;
  font-weight: 600;
}

.fusanet-cookie-link:hover,
.fusanet-cookie-link:focus-visible {
  color: #b8703a;
}

/* Panneau de personnalisation */
.fusanet-cookie-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10002;
  width: min(560px, calc(100vw - 28px));
  max-height: min(88vh, 720px);
  overflow-y: auto;
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  background: #ffffff;
  border: 1px solid rgba(44, 95, 78, 0.22);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  padding: 24px 22px 20px;
  color: #14110e;
}

.fusanet-cookie-panel.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.fusanet-cookie-panel__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(44, 95, 78, 0.1);
  color: #14110e;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.fusanet-cookie-service {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(44, 95, 78, 0.18);
  background: #fdfbf8;
}

.fusanet-cookie-service__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fusanet-cookie-service__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #2c5f4e;
}

.fusanet-cookie-service__desc {
  margin: 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #3d3834;
}

.fusanet-cookie-service__badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(44, 95, 78, 0.12);
  color: #1a3d32;
  white-space: nowrap;
}

/* Interrupteur */
.fusanet-cookie-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.fusanet-cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.fusanet-cookie-switch__slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.fusanet-cookie-switch__slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.fusanet-cookie-switch input:checked + .fusanet-cookie-switch__slider {
  background: #2c5f4e;
}

.fusanet-cookie-switch input:checked + .fusanet-cookie-switch__slider::before {
  transform: translateX(22px);
}

.fusanet-cookie-switch input:disabled + .fusanet-cookie-switch__slider {
  opacity: 0.55;
  cursor: not-allowed;
}

.fusanet-cookie-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(44, 95, 78, 0.15);
}

/* Lien « Gérer les cookies » injecté dans le footer */
.footer-cookie-prefs {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-300, #94a3b8);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-cookie-prefs:hover,
.footer-cookie-prefs:focus-visible {
  color: var(--gold, #f4d58a);
}

@media (max-width: 640px) {
  .fusanet-cookie-banner__inner {
    padding: 18px 16px 16px;
  }

  .fusanet-cookie-banner__inner::before {
    margin: -18px -16px 14px;
  }

  .fusanet-cookie-actions {
    flex-direction: column;
  }

  .fusanet-cookie-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fusanet-cookie-banner,
  .fusanet-cookie-panel,
  .fusanet-cookie-overlay {
    transition: none;
  }
}
