/* Avviso chiusura estiva - palette sa-hd (crema/verde/giallo/ink) */

.sa-cn {
  --sa-cn-cream: #faf6ec;
  --sa-cn-green: #2b9348;
  --sa-cn-green-dark: #1f7135;
  --sa-cn-ink: #10291d;
  --sa-cn-yellow: #fff001;
  --sa-cn-line: rgba(16, 41, 29, .14);
  --sa-cn-muted: rgba(16, 41, 29, .68);

  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: "Avenir bold", "AvenirNextLTPro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sa-cn[hidden] { display: none; }

.sa-cn__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 41, 29, .62);
  backdrop-filter: blur(2px);
  animation: sa-cn-fade .25s ease both;
}

.sa-cn__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  /* dvh dove supportato: su mobile 100vh include barre che non ci sono. */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--sa-cn-cream);
  color: var(--sa-cn-ink);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(16, 41, 29, .34);
  padding: 34px 32px 30px;
  animation: sa-cn-pop .3s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes sa-cn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sa-cn-pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sa-cn__backdrop, .sa-cn__dialog { animation: none; }
}

.sa-cn__x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sa-cn-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.sa-cn__x:hover { background: rgba(16, 41, 29, .08); color: var(--sa-cn-ink); }

.sa-cn__panel[hidden] { display: none; }

.sa-cn__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sa-cn-green);
  font-weight: 700;
}

.sa-cn__title {
  margin: 0 0 12px;
  font-size: clamp(23px, 4.4vw, 30px);
  line-height: 1.14;
  font-weight: 800;
  color: var(--sa-cn-ink);
}

.sa-cn__lead {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--sa-cn-muted);
}
.sa-cn__lead strong { color: var(--sa-cn-ink); }

.sa-cn__badge-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 22px;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(43, 147, 72, .1);
  border: 1px solid rgba(43, 147, 72, .26);
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 600;
}

.sa-cn__check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sa-cn-green);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.sa-cn__section-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--sa-cn-muted);
}

.sa-cn__promos {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.sa-cn__promo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px 11px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--sa-cn-line);
  text-decoration: none;
  color: var(--sa-cn-ink);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.sa-cn__promo:hover {
  transform: translateY(-2px);
  border-color: var(--sa-cn-green);
  box-shadow: 0 8px 18px rgba(16, 41, 29, .12);
}

.sa-cn__promo-badge {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sa-cn-yellow);
  color: var(--sa-cn-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
}

.sa-cn__promo-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.sa-cn__promo-text {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--sa-cn-muted);
}

.sa-cn__all { margin: 0 0 4px; font-size: 13.5px; }
.sa-cn__all a { color: var(--sa-cn-green); font-weight: 700; text-decoration: none; }
.sa-cn__all a:hover { text-decoration: underline; }

.sa-cn__divider {
  height: 1px;
  margin: 20px 0 16px;
  background: var(--sa-cn-line);
}

.sa-cn__ask {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.sa-cn__cta {
  display: block;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--sa-cn-green);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, transform .12s ease;
}
.sa-cn__cta:hover { background: var(--sa-cn-green-dark); color: #fff; }
.sa-cn__cta:active { transform: translateY(1px); }
.sa-cn__cta[disabled] { opacity: .6; cursor: default; }

.sa-cn__cta--link { margin-top: 4px; }

.sa-cn__back {
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 14px;
  color: var(--sa-cn-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.sa-cn__back:hover { color: var(--sa-cn-ink); }

/* ---- form ---- */

.sa-cn__label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.sa-cn__input {
  width: 100%;
  padding: 13px 15px;
  border: 2px solid var(--sa-cn-line);
  border-radius: 12px;
  background: #fff;
  color: var(--sa-cn-ink);
  font-family: inherit;
  font-size: 15.5px;
  transition: border-color .16s ease;
}
.sa-cn__input:focus { outline: none; border-color: var(--sa-cn-green); }
.sa-cn__input.is-invalid { border-color: #c0392b; }

.sa-cn__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sa-cn__consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 13px 0 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--sa-cn-muted);
  cursor: pointer;
}
.sa-cn__consent input {
  flex: 0 0 auto;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--sa-cn-green);
}
.sa-cn__consent a { color: var(--sa-cn-green); }

.sa-cn__error {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(192, 57, 43, .1);
  color: #9c2f22;
  font-size: 13px;
  font-weight: 600;
}
.sa-cn__error[hidden] { display: none; }

.sa-cn__form .sa-cn__cta { margin-top: 14px; }

/* ---- codice ---- */

.sa-cn__code-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 6px 0 18px;
}

.sa-cn__code {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border: 2px dashed var(--sa-cn-green);
  border-radius: 12px;
  background: #fff;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(21px, 5vw, 27px);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--sa-cn-ink);
  user-select: all;
}

.sa-cn__copy {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--sa-cn-ink);
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease;
}
.sa-cn__copy:hover { background: #0a1c13; }
.sa-cn__copy.is-copied { background: var(--sa-cn-green); }

.sa-cn__rules {
  margin: 0 0 20px;
  padding: 0 0 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--sa-cn-muted);
}
.sa-cn__rules li { margin-bottom: 5px; }
.sa-cn__rules li::marker { color: var(--sa-cn-green); }
.sa-cn__rules strong { color: var(--sa-cn-ink); }

/* ---- barra per chi ha gia' il codice ---- */

.sa-cn-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99980;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 44px 8px 14px;
  background: var(--sa-cn-ink, #10291d);
  color: #fff;
  font-family: "Avenir bold", "AvenirNextLTPro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.sa-cn-bar[hidden] { display: none; }

.sa-cn-bar__code {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: #fff001;
  color: #10291d;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
}
.sa-cn-bar__code.is-copied { background: #83ff95; }

.sa-cn-bar__x {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, .7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.sa-cn-bar__x:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---- mobile ---- */

@media (max-width: 560px) {
  .sa-cn { padding: 0; align-items: flex-end; }

  .sa-cn__dialog {
    /* 100% del contenitore inset:0 = viewport reale, niente vh traditori.
       Il safe-area evita che la CTA finisca sotto la home bar dell'iPhone. */
    max-width: none;
    width: 100%;
    max-height: 100%;
    border-radius: 18px 18px 0 0;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .sa-cn__promos { grid-template-columns: 1fr; gap: 7px; }

  .sa-cn__promo {
    flex-direction: row;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
  }
  .sa-cn__promo-title { flex: 1 1 auto; }
  .sa-cn__promo-text { flex: 1 1 100%; }

  .sa-cn__code { font-size: 21px; letter-spacing: .06em; }
  .sa-cn__copy { min-width: 62px; }

  .sa-cn-bar { font-size: 12px; padding: 7px 40px 7px 12px; }
}
