/*! DD Cookie 1.0.0 | DD2006.net Web Agency | https://dd2006.net | GPL-2.0-or-later */

/* ---------- Variabili e temi ---------- */
.ddc,
.ddc-embed {
  --ddc-accent: #1a5fb4;
  --ddc-on-accent: #fff;
  --ddc-bg: #fff;
  --ddc-fg: #1f2328;
  --ddc-muted: #57606a;
  --ddc-line: #d0d7de;
  --ddc-soft: #f3f5f7;
  --ddc-radius: 14px;
  --ddc-shadow: 0 12px 40px rgba(16, 24, 40, .22);
}

.ddc--dark {
  --ddc-bg: #1d2127;
  --ddc-fg: #e8ecf0;
  --ddc-muted: #a2abb5;
  --ddc-line: #3b434d;
  --ddc-soft: #272d35;
  --ddc-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  .ddc--auto,
  .ddc-embed {
    --ddc-bg: #1d2127;
    --ddc-fg: #e8ecf0;
    --ddc-muted: #a2abb5;
    --ddc-line: #3b434d;
    --ddc-soft: #272d35;
    --ddc-shadow: 0 12px 40px rgba(0, 0, 0, .6);
  }
}

/* ---------- Base (protetta dagli stili del template) ---------- */
.ddc,
.ddc *,
.ddc *::before,
.ddc *::after,
.ddc-embed,
.ddc-embed * {
  box-sizing: border-box;
}

.ddc [hidden],
.ddc-embed [hidden] {
  display: none !important;
}

.ddc-banner,
.ddc-prefs {
  margin: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  border: 0;
  color: var(--ddc-fg);
  background: var(--ddc-bg);
  box-shadow: var(--ddc-shadow);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  letter-spacing: normal;
}

.ddc :focus-visible,
.ddc-embed :focus-visible {
  outline: 3px solid var(--ddc-fg);
  outline-offset: 2px;
}

/* ---------- Banner ---------- */
.ddc-banner {
  position: fixed;
  z-index: 2147483000;
  padding: 20px 24px;
}

.ddc-banner[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "title" "text" "links" "actions";
  gap: 10px 32px;
}

/* Barra in basso */
.ddc--bar .ddc-banner {
  inset: auto 0 0 0;
  width: 100%;
  border-top: 1px solid var(--ddc-line);
  padding: 20px max(56px, calc((100% - 1180px) / 2)) 20px max(20px, calc((100% - 1180px) / 2));
}

@media (min-width: 900px) {
  .ddc--bar .ddc-banner[open] {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title actions" "text actions" "links actions";
    align-items: center;
  }

  .ddc--bar .ddc-banner .ddc-actions {
    display: flex;
    flex-wrap: nowrap;
  }

  .ddc--bar .ddc-banner .ddc-btn--ghost {
    order: 0;
  }
}

/* Riquadro in basso a sinistra */
.ddc--box .ddc-banner {
  left: 16px;
  bottom: 16px;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--ddc-line);
  border-radius: var(--ddc-radius);
}

.ddc--box.ddc--reopen-right .ddc-banner {
  left: auto;
  right: 16px;
}

/* Riquadro al centro */
.ddc--center .ddc-banner {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--ddc-line);
  border-radius: var(--ddc-radius);
}

.ddc-title {
  grid-area: title;
  margin: 0;
  padding-right: 32px;
  color: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.ddc-text {
  grid-area: text;
  margin: 0;
  color: var(--ddc-muted);
}

.ddc-text p {
  margin: 0 0 6px;
}

.ddc-text p:last-child {
  margin-bottom: 0;
}

.ddc-links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  font-size: 14px;
}

.ddc-text a,
.ddc-links a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Pulsanti (Accetta e Rifiuta hanno lo stesso peso) ---------- */
.ddc-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ddc-actions .ddc-btn--ghost {
  grid-column: 1 / -1;
  order: 3;
}

.ddc-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 10px 20px;
  border: 2px solid var(--ddc-accent);
  border-radius: 10px;
  background: var(--ddc-accent);
  color: var(--ddc-on-accent);
  box-shadow: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s ease;
}

.ddc-btn:hover {
  filter: brightness(1.1);
}

.ddc-btn--ghost {
  border-color: var(--ddc-line);
  background: transparent;
  color: var(--ddc-fg);
}

.ddc-btn--ghost:hover {
  filter: none;
  background: var(--ddc-soft);
}

.ddc-x {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ddc-muted);
  box-shadow: none;
  cursor: pointer;
}

.ddc-x:hover {
  background: var(--ddc-soft);
  color: var(--ddc-fg);
}

.ddc-x svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Preferenze ---------- */
.ddc-prefs {
  inset: 0;
  margin: auto;
  width: min(680px, calc(100% - 24px));
  max-height: min(88vh, 820px);
  border-radius: var(--ddc-radius);
  overflow: hidden;
}

.ddc-prefs[open] {
  display: flex;
  flex-direction: column;
}

.ddc-prefs::backdrop {
  background: rgba(10, 14, 20, .55);
}

.ddc-prefs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 24px;
  border-bottom: 1px solid var(--ddc-line);
}

.ddc-prefs__head .ddc-title {
  padding: 0;
}

.ddc-prefs__head .ddc-x {
  position: static;
  flex: none;
}

.ddc-prefs__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 24px;
}

.ddc-prefs__body > .ddc-text {
  margin-bottom: 8px;
}

.ddc-prefs__body > .ddc-links {
  margin-top: 12px;
}

.ddc-prefs__foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--ddc-line);
}

@media (min-width: 640px) {
  .ddc-prefs .ddc-actions {
    display: flex;
    justify-content: flex-end;
  }

  .ddc-prefs .ddc-btn--ghost {
    order: 0;
    margin-right: auto;
  }
}

.ddc-cat {
  padding: 14px 0;
  border-top: 1px solid var(--ddc-line);
}

.ddc-cat:first-of-type {
  border-top: 0;
}

.ddc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ddc-cat__name {
  font-weight: 600;
}

.ddc-cat__desc {
  margin: 6px 0 0;
  color: var(--ddc-muted);
  font-size: 14px;
}

.ddc-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ddc-soft);
  color: var(--ddc-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ddc-services {
  margin-top: 8px;
  font-size: 13px;
}

.ddc-services summary {
  display: list-item;
  color: var(--ddc-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Interruttore */
.ddc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  cursor: pointer;
}

.ddc-switch input {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ddc-switch__ui {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--ddc-line);
  transition: background .2s ease;
}

.ddc-switch__ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}

.ddc-switch input:checked + .ddc-switch__ui {
  background: var(--ddc-accent);
}

.ddc-switch input:checked + .ddc-switch__ui::after {
  transform: translateX(20px);
}

.ddc-switch input:focus-visible + .ddc-switch__ui {
  outline: 3px solid var(--ddc-fg);
  outline-offset: 2px;
}

.ddc-switch input:disabled,
.ddc-switch input:disabled + .ddc-switch__ui {
  cursor: default;
  opacity: .6;
}

/* ---------- Tabelle servizi/cookie ---------- */
.ddc-table__wrap {
  overflow-x: auto;
}

.ddc-table {
  width: 100%;
  margin: 8px 0 0;
  border-collapse: collapse;
  font-size: 13px;
}

.ddc-table th,
.ddc-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--ddc-line, rgba(127, 127, 127, .35));
  text-align: left;
  vertical-align: top;
}

.ddc-table th {
  font-weight: 600;
}

.ddc-table small {
  font-weight: 400;
  opacity: .8;
}

.ddc-table code {
  font-size: 12px;
  word-break: break-all;
}

/* Elenco per la privacy policy ({ddcookie-list}): eredita colori e caratteri della pagina */
.ddc-list {
  margin: 1em 0;
}

.ddc-list .ddc-table {
  font-size: .9em;
}

/* ---------- Pulsante per riaprire le preferenze ---------- */
.ddc-reopen {
  position: fixed;
  z-index: 2147482999;
  left: 16px;
  bottom: 16px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ddc-accent);
  color: var(--ddc-on-accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  cursor: pointer;
}

.ddc--reopen-right .ddc-reopen {
  left: auto;
  right: 16px;
}

.ddc-reopen svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ---------- Contenuti incorporati bloccati ---------- */
.ddc-embed {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 1em;
  padding: 16px;
  border: 1px dashed var(--ddc-line);
  border-radius: 10px;
  background: var(--ddc-soft);
  color: var(--ddc-fg);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.ddc-embed--r43 { aspect-ratio: 4 / 3; }
.ddc-embed--r11 { aspect-ratio: 1 / 1; }
.ddc-embed--r916 { aspect-ratio: 9 / 16; max-width: 420px; }

.ddc-embed__box {
  max-width: 520px;
}

.ddc-embed__title {
  margin: 0 0 6px;
  font-weight: 700;
}

.ddc-embed__text {
  margin: 0 0 12px;
  color: var(--ddc-muted);
}

.ddc-embed__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
}

.ddc-embed .ddc-btn {
  white-space: normal;
}

.ddc-embed__open {
  margin: 10px 0 0;
  font-size: 14px;
}

.ddc-embed__open a {
  color: inherit;
  text-decoration: underline;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .ddc-banner {
    padding: 16px;
  }

  .ddc--bar .ddc-banner {
    padding: 16px;
  }

  .ddc-btn {
    padding: 10px 12px;
    white-space: normal;
  }

  .ddc-prefs__head,
  .ddc-prefs__body,
  .ddc-prefs__foot {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- Movimento ridotto e stampa ---------- */
@media (prefers-reduced-motion: reduce) {
  .ddc *,
  .ddc-embed * {
    transition: none !important;
  }
}

@media print {
  .ddc,
  .ddc-embed__actions {
    display: none !important;
  }
}
