/* 2026-10-27: banner e pannello preferenze cookie, ripresi dallo stile di wildout.eu
   (Bootstrap scuro + token --wo-*), riscritti senza Bootstrap per Divi. */
#rfc-banner, #rfc-modal, .rfc-embed {
  --rfc-bg: #1e1e1e;
  --rfc-bg-elev: #262626;
  --rfc-gray: #a0a0a0;
  --rfc-gray-soft: #3a3a3a;
  --rfc-border: #676767;
  --rfc-text: #e0e0e0;
  --rfc-primary: #eb5f38;
  --rfc-success: #4a8f5b;
  --rfc-success-fg: #6ab37b;
  --rfc-warning: #c89940;
  --rfc-event: #fbbe51;
  --rfc-event-hi: #fcc96d;
  --rfc-info: #5a8aa8;
  --rfc-ease: cubic-bezier(0.25, 1, 0.5, 1);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
#rfc-banner *, #rfc-modal *, .rfc-embed * { box-sizing: border-box; }

.rfc-i { width: 1em; height: 1em; vertical-align: -0.125em; margin-right: .5rem; flex-shrink: 0; }
.rfc-btn .rfc-i { margin: 0 0 0 .25rem; }
.rfc-c-warning { color: var(--rfc-warning); }
.rfc-c-success { color: var(--rfc-success); }
.rfc-c-info { color: var(--rfc-info); }
.rfc-muted { color: var(--rfc-text); }

/* Pulsanti (pillola, come i .btn di wildout) */
.rfc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: #fff;
  font-weight: 600; font-size: 14px; line-height: 1.2; font-family: inherit;
  text-decoration: none !important; cursor: pointer;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.3);
  transition: transform 120ms var(--rfc-ease), background-color 120ms var(--rfc-ease), color 120ms var(--rfc-ease), border-color 120ms var(--rfc-ease);
}
.rfc-btn:hover { transform: translateY(-1px); }
.rfc-btn:focus-visible, .rfc-close:focus-visible, .rfc-switch input:focus-visible + span { outline: 2px solid var(--rfc-event); outline-offset: 2px; }
.rfc-btn-outline-secondary { border-color: var(--rfc-border); color: var(--rfc-gray); }
.rfc-btn-outline-secondary:hover { background: var(--rfc-border); color: #fff; }
.rfc-btn-outline-light { border-color: #f8f9fa; color: #f8f9fa; }
.rfc-btn-outline-light:hover { background: #f8f9fa; color: #000; }
.rfc-btn-success { background: var(--rfc-success); border-color: var(--rfc-success); font-weight: 700; padding: 10px 24px; }
.rfc-btn-success:hover { background: #3f7a4d; }
.rfc-btn-outline-success { border-color: var(--rfc-success); color: var(--rfc-success-fg); }
.rfc-btn-outline-success:hover { background: var(--rfc-success); color: #fff; }
.rfc-btn-warning { background: var(--rfc-event); border-color: var(--rfc-event); color: var(--rfc-bg); font-weight: 700; }
.rfc-btn-warning:hover { background: var(--rfc-event-hi); border-color: var(--rfc-event-hi); }
.rfc-btn-outline-warning { border-color: var(--rfc-warning); color: var(--rfc-event); }
.rfc-btn-outline-warning:hover { background: var(--rfc-warning); color: var(--rfc-bg); }

/* Banner in basso */
#rfc-banner {
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 100000;
  transition: transform .5s var(--rfc-ease), opacity .5s var(--rfc-ease);
}
#rfc-banner.rfc-hidden { transform: translateY(150%); opacity: 0; pointer-events: none; }
#rfc-banner.rfc-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.rfc-banner-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1140px; margin: 16px auto; padding: 16px;
  background: var(--rfc-bg); border: 1px solid var(--rfc-border); border-radius: .5rem;
  box-shadow: 0 1rem 3rem rgba(0,0,0,.5);
}
@media (max-width: 1172px) { .rfc-banner-card { margin: 16px; } }
.rfc-banner-text { flex: 7 1 380px; }
.rfc-banner-text h6 { display: flex; align-items: center; margin: 0 0 4px; padding: 0; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; font-family: inherit; }
.rfc-banner-text p { margin: 0; padding: 0; color: var(--rfc-text); font-size: .8rem; line-height: 1.4; }
.rfc-banner-buttons { flex: 5 1 300px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 767.98px) { .rfc-banner-buttons { justify-content: center; } }

/* Pannello preferenze */
.rfc-modal {
  position: fixed; inset: 0; z-index: 100001;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.5);
}
.rfc-modal[hidden] { display: none; }
.rfc-modal-dialog {
  display: flex; flex-direction: column;
  width: 100%; max-width: 800px; max-height: calc(100vh - 32px);
  background: var(--rfc-bg-elev); color: #fff;
  border: 1px solid var(--rfc-gray-soft); border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.rfc-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 8px; }
.rfc-modal-header h5 { display: flex; align-items: center; margin: 0; padding: 0; color: #fff; font-weight: 800; font-size: 22px; line-height: 1.2; font-family: inherit; }
.rfc-close { border: 0; background: none; color: #fff; opacity: .6; font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.rfc-close:hover { opacity: 1; }
.rfc-modal-body { padding: 8px 24px; overflow-y: auto; font-size: .875em; line-height: 1.5; color: #cfcfcf; }
.rfc-modal-body p { margin: 0 0 1rem; padding: 0; }
.rfc-modal-body a { color: var(--rfc-event); }
.rfc-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 8px; padding: 8px 16px;
  background: rgba(0,0,0,.25); border: 1px solid var(--rfc-border); border-radius: .375rem;
}
.rfc-card-title { display: flex; align-items: center; margin-bottom: 4px; color: #fff; font-weight: 600; }
.rfc-modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 16px 24px 24px; }
@media (max-width: 575.98px) {
  .rfc-modal { padding: 0; }
  .rfc-modal-dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .rfc-modal-footer .rfc-btn { flex: 1 1 100%; }
}

.rfc-consent-id { margin: 12px 0 0 !important; font-size: .8em; color: var(--rfc-gray); }
.rfc-consent-id code { background: none; color: var(--rfc-text); padding: 0; }

/* Interruttori (form-switch) */
.rfc-switch { position: relative; flex-shrink: 0; width: 2.5em; height: 1.4em; margin: 0; }
.rfc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.rfc-switch input:disabled { cursor: default; }
.rfc-switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: transparent; border: 1px solid var(--rfc-border);
  transition: background-color 120ms var(--rfc-ease), border-color 120ms var(--rfc-ease);
}
.rfc-switch span::after {
  content: ""; position: absolute; top: 50%; left: .2em; width: 1em; height: 1em; margin-top: -.5em;
  border-radius: 50%; background: var(--rfc-border);
  transition: transform 120ms var(--rfc-ease), background-color 120ms var(--rfc-ease);
}
.rfc-switch input:checked + span { background: var(--rfc-primary); border-color: var(--rfc-primary); }
.rfc-switch input:checked + span::after { transform: translateX(1.05em); background: #fff; }
.rfc-switch input:disabled + span { opacity: .5; }

/* Segnaposto video senza consenso */
.rfc-embed { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin: 0 0 1.5em; }
.rfc-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rfc-embed-ph {
  display: flex; align-items: center; justify-content: center; height: 100%; min-height: 200px;
  padding: 16px; text-align: center;
  background: var(--rfc-bg); border: 1px solid var(--rfc-border); border-radius: .375rem;
}
.rfc-embed-ph p { margin: 0 0 8px; padding: 0; color: var(--rfc-text); font-size: .875em; }
.rfc-embed-icon { display: block; width: 2rem; height: 2rem; margin: 0 auto 8px; color: var(--rfc-gray); }
.rfc-embed-ph .rfc-btn { min-height: 36px; padding: 6px 14px; font-size: 13px; margin: 4px; }

/* Link "Gestisci cookie" nel footer Divi */
.rfc-manage { float: right; margin-left: 16px; color: inherit !important; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  #rfc-banner, .rfc-btn, .rfc-switch span, .rfc-switch span::after { transition: none; }
}
