:root {
  --info-light-bg: linear-gradient(180deg, #f3f7fc 0%, #e9f1fb 100%);
  --info-light-text: #1f2a37;
  --info-light-muted: #4a5b70;
  --info-light-link: #1f5faa;
  --info-light-link-strong: #154a86;
  --info-light-soft: #e7f0fb;
  --info-light-border: #d8e4f4;
  --info-light-button-border: #c8daef;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.info-page {
  --page-bg: var(--info-light-bg);
  --page-text: var(--info-light-text);
  --page-muted: var(--info-light-muted);
  --page-link: var(--info-light-link);
  --page-link-strong: var(--info-light-link-strong);
  --page-top-button-text: var(--info-light-link-strong);
  --page-button-border: var(--info-light-button-border);
  --page-button-bg: #ffffff;
  --page-button-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  --page-chip-bg: #ffffff;
  --page-chip-text: var(--info-light-link-strong);
  --page-card-bg: #ffffff;
  --page-card-border: var(--info-light-border);
  --page-card-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  --page-secondary-bg: var(--info-light-soft);
  --page-secondary-text: var(--info-light-link-strong);
  --page-title-color: var(--info-light-link-strong);
  --page-section-color: var(--info-light-link-strong);
  --page-section-border: #e7eef8;
  --page-shell-max: 860px;
  --page-card-padding: 24px 20px 26px;
  --page-footer-bg: rgba(255, 255, 255, 0.9);
  --page-footer-border: rgba(31, 95, 170, 0.12);
  font-family: 'Nunito', sans-serif;
  background: var(--page-bg);
  color: var(--page-text);
  min-height: 100vh;
}

body.page-chi-siamo {
  --page-shell-max: 860px;
}

body.page-per-genitori {
  --page-shell-max: 860px;
}

body.page-per-insegnanti {
  --page-shell-max: 860px;
}

body.page-ai-info {
  --page-shell-max: 900px;
}

body.page-accessibilita {
  --page-bg: linear-gradient(165deg, #1c6eb4 0%, #2d6cdf 60%, #8ab8ff 100%);
  --page-text: #0f2747;
  --page-muted: rgba(255, 255, 255, 0.97);
  --page-link: #ffffff;
  --page-link-strong: #0f2747;
  --page-top-button-text: #1c6eb4;
  --page-button-border: rgba(255, 255, 255, 0.95);
  --page-button-bg: #ffffff;
  --page-button-shadow: 0 5px 14px rgba(0, 0, 0, 0.2);
  --page-chip-bg: #0b2b56;
  --page-chip-text: #ffffff;
  --page-card-bg: rgba(244, 248, 255, 0.96);
  --page-card-border: rgba(208, 224, 246, 0.9);
  --page-card-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
  --page-secondary-bg: rgba(232, 240, 255, 0.96);
  --page-secondary-text: #0f2747;
  --page-title-color: #0f2747;
  --page-section-color: #0f2747;
  --page-section-border: rgba(156, 185, 225, 0.7);
  --page-breadcrumb-bg: #0b2b56;
  --page-breadcrumb-border: rgba(255, 255, 255, 0.18);
  --page-breadcrumb-padding: 8px 12px;
  --page-shell-max: 820px;
  --page-footer-bg: rgba(18, 71, 123, 0.86);
  --page-footer-border: rgba(255, 255, 255, 0.18);
}

body.page-supporta {
  --page-bg: linear-gradient(165deg, #0077b6 0%, #00b4d8 100%);
  --page-text: #12324f;
  --page-muted: rgba(255, 255, 255, 0.97);
  --page-link: #ffffff;
  --page-link-strong: #12324f;
  --page-top-button-text: #0077b6;
  --page-button-border: rgba(255, 255, 255, 0.95);
  --page-button-bg: #ffffff;
  --page-button-shadow: 0 5px 14px rgba(0, 0, 0, 0.2);
  --page-chip-bg: #08405f;
  --page-chip-text: #ffffff;
  --page-card-bg: rgba(244, 251, 255, 0.96);
  --page-card-border: rgba(190, 226, 235, 0.9);
  --page-card-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
  --page-secondary-bg: rgba(238, 249, 251, 0.96);
  --page-secondary-text: #12324f;
  --page-title-color: #12324f;
  --page-section-color: #12324f;
  --page-section-border: rgba(163, 210, 222, 0.75);
  --page-breadcrumb-bg: #08405f;
  --page-breadcrumb-border: rgba(255, 255, 255, 0.18);
  --page-breadcrumb-padding: 8px 12px;
  --page-shell-max: 760px;
  --page-footer-bg: rgba(0, 90, 141, 0.88);
  --page-footer-border: rgba(255, 255, 255, 0.18);
}

body.page-supporto-satispay {
  --page-bg: #ff3d00;
  --page-text: #3d1706;
  --page-muted: rgba(255, 255, 255, 0.97);
  --page-link: #ffffff;
  --page-link-strong: #3d1706;
  --page-top-button-text: #ff3d00;
  --page-button-border: rgba(255, 255, 255, 0.95);
  --page-button-bg: #ffffff;
  --page-button-shadow: 0 5px 14px rgba(0, 0, 0, 0.2);
  --page-chip-bg: #6a2209;
  --page-chip-text: #ffffff;
  --page-card-bg: rgba(255, 243, 238, 0.97);
  --page-card-border: rgba(248, 208, 193, 0.9);
  --page-card-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
  --page-secondary-bg: rgba(255, 240, 232, 0.97);
  --page-secondary-text: #3d1706;
  --page-title-color: #3d1706;
  --page-section-color: #3d1706;
  --page-section-border: rgba(225, 153, 126, 0.72);
  --page-breadcrumb-bg: #6a2209;
  --page-breadcrumb-border: rgba(255, 255, 255, 0.18);
  --page-breadcrumb-padding: 8px 12px;
  --page-shell-max: 760px;
  --page-card-padding: 22px 18px 24px;
  --page-footer-bg: rgba(203, 52, 0, 0.88);
  --page-footer-border: rgba(255, 255, 255, 0.18);
}

body.info-page .wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 132px;
}

body.info-page .top-links,
body.info-page .breadcrumbs,
body.info-page .card {
  width: 100%;
  max-width: var(--page-shell-max);
}

body.info-page .top-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.info-page .breadcrumbs {
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--page-breadcrumb-padding, 0);
  border-radius: var(--page-breadcrumb-radius, 999px);
  background: var(--page-breadcrumb-bg, transparent);
  border: 1px solid var(--page-breadcrumb-border, transparent);
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--page-muted);
}

body.info-page .breadcrumbs a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--page-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.info-page .back-btn,
body.info-page .link-btn,
body.info-page .faq-btn,
body.info-page .alt-btn {
  align-self: flex-start;
  text-decoration: none;
  color: var(--page-top-button-text);
  background: var(--page-button-bg);
  border-radius: 999px;
  font-weight: 900;
  padding: 10px 16px;
  border: 2px solid var(--page-button-border);
  box-shadow: var(--page-button-shadow);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.info-page .link-btn,
body.info-page .faq-btn,
body.info-page .alt-btn {
  background: var(--page-chip-bg);
  color: var(--page-chip-text);
}

body.info-page .card {
  margin-top: 16px;
  background: var(--page-card-bg);
  border: 1px solid var(--page-card-border);
  border-radius: 24px;
  padding: var(--page-card-padding);
  box-shadow: var(--page-card-shadow);
}

body.info-page .title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.9rem, 7vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 14px;
  color: var(--page-title-color);
}

body.info-page .text {
  font-size: clamp(1rem, 3.8vw, 1.15rem);
  line-height: 1.65;
  font-weight: 700;
  color: var(--page-text);
}

body.info-page .text + .text {
  margin-top: 12px;
}

body.info-page .section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--page-section-border);
}

body.info-page .section h2,
body.info-page .section-title {
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--page-section-color);
}

body.info-page .list,
body.info-page .ul,
body.info-page .cta-list {
  margin: 10px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

body.info-page .list li,
body.info-page .ul li,
body.info-page .cta-list li {
  font-size: clamp(1rem, 3.8vw, 1.1rem);
  font-weight: 800;
  line-height: 1.5;
  color: var(--page-text);
}

body.info-page .contact-mail a,
body.info-page .text-link,
body.info-page .card a:not(.action-btn):not(.back-btn):not(.link-btn):not(.faq-btn):not(.alt-btn) {
  color: var(--page-link-strong);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

body.info-page .actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.info-page .action-btn {
  text-decoration: none;
  border-radius: 14px;
  border: 2px solid var(--page-button-border);
  background: #ffffff;
  color: var(--page-top-button-text);
  font-weight: 900;
  padding: 10px 14px;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.16);
}

body.info-page .action-btn.secondary {
  background: var(--page-secondary-bg);
  color: var(--page-secondary-text);
}

body.info-page .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.92em;
}

body.info-page .qr-wrap {
  margin: 20px auto 0;
  width: min(74vw, 360px);
  max-width: 100%;
}

body.info-page .qr-image {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 20px;
  border: 4px solid #fff;
  box-shadow: inset 0 0 0 2px #d9d9d9, 0 8px 18px rgba(0, 0, 0, 0.22);
}

body.info-page .qr-note {
  margin-top: 10px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--page-muted);
}

body.info-page .skip-link {
  position: absolute;
  top: -100px;
  left: 10px;
  background: #fff;
  color: #111;
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  z-index: 9999;
}

body.info-page .skip-link:focus {
  top: 10px;
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--page-footer-bg, rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--page-footer-border, rgba(31, 95, 170, 0.12));
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 8px;
  z-index: 210;
}

.footer-link {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--page-muted, var(--info-light-muted));
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.footer-link:focus-visible {
  outline: 3px solid var(--page-link-strong, var(--info-light-link-strong));
  outline-offset: 2px;
  border-radius: 10px;
}

.footer-link:hover {
  color: var(--page-link-strong, var(--info-light-link-strong));
}

.footer-version {
  cursor: default;
  color: inherit;
  opacity: 0.95;
}

.footer-support-cta {
  flex: 0 0 auto;
  width: fit-content;
  max-width: calc(100% - 8px);
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #ff3d00;
  color: #fff !important;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s, filter 0.15s;
}

.footer-support-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f4f4f4;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #999;
  cursor: pointer;
}

.modal-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.7rem;
  margin-bottom: 4px;
  color: var(--page-link-strong, var(--info-light-link-strong));
}

.modal-body {
  font-size: 0.93rem;
  line-height: 1.7;
  color: #555;
}

.modal-body h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.08rem;
  margin: 14px 0 6px;
  color: var(--page-link-strong, var(--info-light-link-strong));
}

.modal-body a {
  color: var(--page-link-strong, var(--info-light-link-strong));
  font-weight: 800;
  text-decoration: none;
}

.modal-body a:hover {
  text-decoration: underline;
}

@media (max-width: 460px) {
  body.info-page .card {
    padding: 18px 14px 20px;
  }

  body.page-supporto-satispay .qr-wrap {
    width: min(82vw, 340px);
  }
}

@media (hover: none) {
  .back-btn:hover,
  .link-btn:hover,
  .faq-btn:hover,
  .alt-btn:hover,
  .action-btn:hover,
  .footer-support-cta:hover {
    transform: none !important;
    filter: none !important;
  }
}

html[data-motion='reduce'] *,
html[data-motion='reduce'] *::before,
html[data-motion='reduce'] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* =========================================================================
   FASE 4 — Info pages: restyle Wada Sanzo. SOLO modalita standard.
   Guardia html:not([data-palette="okabe-ito"]).
   Preservati intatti: body.page-accessibilita (gradiente blu intenzionale)
   e body.page-supporta (gradiente azzurro intenzionale). Entrambi
   ridefiniscono --page-* direttamente, non usano --info-light-*.
   ========================================================================= */

html:not([data-palette="okabe-ito"]) {
  --info-light-bg: linear-gradient(180deg, var(--ws-cartridge-buff) 0%, var(--ws-olive-buff) 100%);
  --info-light-text: var(--ws-slate-black);
  --info-light-muted: var(--ws-hays-russet);
  --info-light-link: var(--ws-hortense-blue);
  --info-light-link-strong: #2a5a8a;
  --info-light-soft: var(--ws-olive-buff);
  --info-light-border: var(--ws-cinnamon-border);
  --info-light-button-border: var(--ws-cinnamon-border);
}
