:root {
  --primary: #FFE719;
  --primary-hover: #E6CF15;
  --bg-main: #FAFAF5;
  --bg-secondary: #F4F4ED;
  --bg-card: #FFFFFF;
  --text-main: #111111;
  --border-light: #E5E5DC;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-base);
  background-color: var(--bg-main);
  margin: 0;
  padding: 0;
}

/* Tipografia minima necessaria */
h4, h5, h6, p {
  margin: 0;
  font-family: var(--font-base);
}

h4 { font-size: 22px; line-height: 1.3; font-weight: 700; }
h5 { font-size: 18px; line-height: 1.4; font-weight: 500; }
h6 { font-size: 16px; line-height: 1.4; font-weight: 500; }
p  { font-size: 16px; line-height: 1.6; font-weight: 300; }

/* Utility usate dal banner */
.top-margin-small { margin-top: 6px; }
.top-margin-mid { margin-top: 12px; }
.top-margin-large { margin-top: 24px; }

.hyperlink {
  text-decoration: none;
  color: var(--primary-hover);
  font-weight: 300;
}

.hyperlink:hover {
  text-decoration: underline;
}

/* Bottone primario usato nel banner */
.btn {
  display: inline-block;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  padding: 16px 34px;
  background-color: var(--primary);
  color: var(--text-main);
  border: solid 1px var(--primary);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-hover);
  border: solid 1px var(--primary-hover);
}

/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-right: solid 7px var(--primary);
  border-bottom: solid 7px var(--primary);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  padding: 26px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
  pointer-events: none;
}

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

.cookie-banner__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.cookie-banner__text {
  flex: 1;
  color: var(--text-main);
}

.cookie-banner__text h5 {
  color: var(--text-main);
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.cookie-btn {
  padding: 14px 22px;
}

.cookie-btn-secondary {
  display: inline-block;
  text-align: center;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  text-transform: uppercase;
  padding: 14px 22px;
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
  cursor: pointer;
}

.cookie-btn-secondary:hover {
  background: var(--bg-secondary);
}

/* COOKIE MODAL */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}

.cookie-modal.is-active {
  display: block;
}

.cookie-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.cookie-modal__box {
  position: relative;
  z-index: 2;
  width: min(680px, calc(100% - 32px));
  margin: 6vh auto 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-right: solid 7px var(--primary);
  border-bottom: solid 7px var(--primary);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  padding: 28px;
}

.cookie-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.cookie-modal__close {
  background: transparent;
  border: none;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-main);
}

.cookie-modal__body {
  margin-top: 18px;
}

.cookie-modal__footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.cookie-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--border-light);
}

.cookie-switch {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 32px;
  flex-shrink: 0;
}

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

.cookie-slider {
  position: absolute;
  inset: 0;
  background: #d8d8cf;
  transition: 0.25s ease;
  border-radius: 999px;
  cursor: pointer;
}

.cookie-slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 4px;
  top: 4px;
  background: white;
  border-radius: 50%;
  transition: 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.16);
}

.cookie-switch input:checked + .cookie-slider {
  background: var(--primary);
}

.cookie-switch input:checked + .cookie-slider::before {
  transform: translateX(26px);
}

.cookie-switch--disabled {
  opacity: 0.7;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  h4 { font-size: 18px; }
  h5 { font-size: 16px; }
  h6 { font-size: 15px; }
  p  { font-size: 15px; }

  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 18px;
  }

  .cookie-banner__content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner__actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .cookie-banner__actions .btn,
  .cookie-banner__actions .cookie-btn-secondary,
  .cookie-modal__footer .btn,
  .cookie-modal__footer .cookie-btn-secondary {
    width: 100%;
  }

  .cookie-modal__box {
    width: calc(100% - 20px);
    margin-top: 4vh;
    padding: 20px;
  }

  .cookie-option {
    align-items: flex-start;
  }
}