#fdc-cookie-banner,
#fdc-cookie-modal {
  font-family: inherit;
}

.fdc-cc-hidden {
  display: none !important;
}

/* ===== Banner principale ===== */

#fdc-cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fdc-cc-inner {
  width: min(720px, 100%);
  background: #ffffff;
  border: 1px solid #dfe7e3;
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.30);
  padding: 28px;
}

.fdc-cc-copy {
  text-align: left;
}

.fdc-cc-title {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  color: #153b2f;
  margin-bottom: 10px;
}

.fdc-cc-copy p,
.fdc-cc-modal-card p {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.6;
}

.fdc-cc-links {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.fdc-cc-links a {
  color: #167a55;
  text-decoration: underline;
  font-size: 13px;
}

.fdc-cc-actions,
.fdc-cc-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fdc-cc-actions {
  margin-top: 22px;
}

.fdc-cc-btn {
  appearance: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  transition: .15s ease;
}

.fdc-cc-btn-primary {
  background: #188b61;
  color: #ffffff;
  border: 1px solid #188b61;
}

.fdc-cc-btn-primary:hover {
  background: #126d4c;
  border-color: #126d4c;
}

.fdc-cc-btn-secondary {
  background: #ffffff;
  color: #24473a;
  border: 1px solid #9fb7ad;
}

.fdc-cc-btn-secondary:hover {
  background: #f3f7f5;
}

#fdc-cc-reject,
#fdc-cc-accept {
  flex: 1 1 170px;
}

#fdc-cc-preferences {
  flex: 1 1 140px;
}

/* ===== Finestra preferenze ===== */

#fdc-cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fdc-cc-modal-card {
  width: min(620px, 100%);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 22px;
}

.fdc-cc-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.fdc-cc-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}

.fdc-cc-pref-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #edf0ee;
}

.fdc-cc-pref-row strong {
  display: block;
  margin-bottom: 4px;
  color: #1f2937;
}

.fdc-cc-always {
  font-size: 12px;
  font-weight: 700;
  color: #188b61;
  white-space: nowrap;
}

.fdc-cc-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex: 0 0 auto;
}

.fdc-cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fdc-cc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  transition: .2s;
  border-radius: 999px;
}

.fdc-cc-slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.fdc-cc-switch input:checked + .fdc-cc-slider {
  background: #188b61;
}

.fdc-cc-switch input:checked + .fdc-cc-slider:before {
  transform: translateX(22px);
}

.fdc-cc-modal-actions {
  justify-content: flex-end;
  padding-top: 18px;
}

/* ===== Mobile ===== */

@media (max-width: 768px) {
  #fdc-cookie-banner {
    padding: 14px;
    align-items: flex-end;
  }

  .fdc-cc-inner {
    padding: 20px;
    border-radius: 16px 16px 10px 10px;
  }

  .fdc-cc-title {
    font-size: 21px;
  }

  .fdc-cc-copy p {
    font-size: 14px;
  }

  .fdc-cc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #fdc-cc-preferences {
    grid-column: 1 / -1;
  }

  .fdc-cc-btn {
    width: 100%;
  }

  .fdc-cc-modal-card {
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .fdc-cc-actions {
    grid-template-columns: 1fr;
  }

  #fdc-cc-preferences {
    grid-column: auto;
  }
}
