/* IoNova - ETS — stili condivisi */

:root {
  --bg: #faf8ff;
  --bg-elevated: #ffffff;
  --text: #1a1523;
  --text-muted: #5e5670;
  --border: #e8e2f0;
  --accent: #7c5cbf;
  --accent-dark: #5f4499;
  --accent-soft: #ede6f8;
  --warm: #e8927c;
  --warm-soft: #fdeee9;
  --sky: #6ba3c7;
  --sky-soft: #e8f3fa;
  --moon-light: #d8d0e8;
  --moon-mid: #9a8fb0;
  --moon-dark: #2d2640;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --shadow: 0 4px 24px rgba(124, 92, 191, 0.08);
  --shadow-hover: 0 8px 32px rgba(124, 92, 191, 0.14);
  --max-width: 72rem;
  --header-height: 4.5rem;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.logo-img {
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(250, 248, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.site-domain {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.brand img {
  width: 2.75rem;
  height: 2.75rem;
}

.footer-domain {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.footer-domain a {
  color: var(--warm);
  text-decoration: none;
}

.footer-domain a:hover {
  color: var(--bg-elevated);
  text-decoration: underline;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.35rem;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 1px;
  transition: var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent-dark);
  text-decoration: none;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0 1.5rem;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-inline: 1rem;
  }

  .site-nav a {
    display: block;
    padding: 0.65rem 0.5rem;
  }
}

@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }

  .site-nav ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.65rem, 1.5vw, 1.35rem);
  }

  .site-nav a {
    font-size: 0.875rem;
    white-space: nowrap;
  }
}

/* Hero */

.hero {
  position: relative;
  padding: 4rem 0 5rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 80%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(124, 92, 191, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(232, 146, 124, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%, rgba(107, 163, 199, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 769px) {
  .hero {
    padding: 5rem 0 6rem;
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo {
  width: min(18rem, 80vw);
  margin-inline: auto;
  filter: drop-shadow(0 16px 48px rgba(124, 92, 191, 0.22));
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-motto {
  margin: 0 0 1.5rem;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--bg-elevated);
}

.btn-primary:hover {
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: var(--shadow);
}

/* Sections */

.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--accent-soft) 100%);
  border-block: 1px solid var(--border);
}

.section-header {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Cards grid */

.cards-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .cards-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  padding: 1.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition), transform var(--transition);
}

.section-alt .card {
  background: var(--bg-elevated);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  border-radius: 50%;
}

.cards-grid--3 .card:nth-child(1) .card-icon {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.cards-grid--3 .card:nth-child(2) .card-icon {
  background: var(--warm-soft);
  color: #c96a52;
}

.card-meta {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.project-card__subtitle {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
}

.project-card__detail {
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.project-card__link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.project-card__link:hover {
  text-decoration: underline;
}

.projects-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cards-grid--3 .card:nth-child(3) .card-icon {
  background: var(--sky-soft);
  color: #4a85a8;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Memory block */

.memory-block {
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--warm-soft) 55%, var(--sky-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.memory-block a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.memory-block a:hover {
  text-decoration: underline;
}

.memory-block h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
}

.memory-block p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.memory-block p:last-child {
  margin-bottom: 0;
}

.memory-block strong {
  color: var(--text);
  font-weight: 600;
}

.memory-photo {
  margin: 2rem auto 0;
  max-width: 22rem;
  text-align: center;
}

.memory-photo img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.memory-photo figcaption {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
}

/* CTA band */

/* 5 per mille (homepage) */

.cinque-per-mille {
  padding: 2rem 0;
  background: linear-gradient(135deg, var(--warm-soft) 0%, var(--accent-soft) 55%, var(--sky-soft) 100%);
  border-block: 1px solid var(--border);
}

.cinque-per-mille__inner {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

@media (min-width: 768px) {
  .cinque-per-mille__inner {
    grid-template-columns: 1fr auto;
    gap: 2rem;
    padding: 1.75rem 2rem;
  }
}

.cinque-per-mille__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.cinque-per-mille__content h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
}

.cinque-per-mille__content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.cinque-per-mille__steps {
  margin-top: 0.65rem !important;
}

.cinque-per-mille__cf {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  text-align: center;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
}

.cinque-per-mille__cf-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cinque-per-mille__cf-value {
  display: block;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
}

.cta-band {
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 45%, #9b6fd4 100%);
  color: var(--bg-elevated);
  border-radius: var(--radius-lg);
}

.cta-band h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
}

.cta-band p {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
}

.cta-band .btn-primary {
  background: var(--bg-elevated);
  color: var(--accent-dark);
}

.cta-band .btn-primary:hover {
  background: var(--warm-soft);
}

/* Footer */

.site-footer {
  padding: 3rem 0 2rem;
  background: linear-gradient(160deg, var(--moon-dark) 0%, #3d2f5c 100%);
  color: var(--moon-light);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 600px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.site-footer .brand {
  color: var(--bg-elevated);
  margin-bottom: 0.75rem;
}

.site-footer .brand img {
  width: 2.5rem;
  height: 2.5rem;
}

.footer-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--moon-mid);
}

.site-footer h3 {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg-elevated);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0.4rem;
}

.site-footer a {
  font-size: 0.9rem;
  color: var(--moon-light);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--bg-elevated);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: var(--moon-mid);
  text-align: center;
}

/* Pagine documento */

.page-hero {
  padding: 3rem 0 2rem;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0;
  max-width: 40rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.pdf-viewer {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.pdf-fallback {
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

.pdf-fallback a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.pdf-fallback a:hover {
  text-decoration: underline;
}

/* Pagina contatti */

.contact-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  padding: 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.contact-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.contact-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Pagina Chi siamo — team */

.team-intro {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.team-intro p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.team-intro p:last-child {
  margin-bottom: 0;
}

.team-grid {
  display: grid;
  gap: 2rem;
  align-items: stretch;
}

.team-grid--leadership {
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .team-grid--leadership {
    grid-template-columns: repeat(2, 1fr);
  }
}

.team-grid--members {
  margin-top: 0.5rem;
}

@media (min-width: 600px) {
  .team-grid--members {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .team-grid--members {
    grid-template-columns: repeat(3, 1fr);
  }
}

.team-subheading {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.team-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.team-card--lead {
  border-color: rgba(124, 92, 191, 0.45);
  box-shadow: var(--shadow-hover);
}

.team-card--lead .team-card__label {
  font-size: 0.8rem;
}

.team-card__media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--sky-soft) 100%);
}

.team-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.team-card__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem 1.5rem 1.75rem;
}

.team-card__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.team-card__name {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.team-card__role {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
}

.team-card__bio {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.team-card__bio p {
  margin: 0 0 0.85rem;
}

.team-card__bio p:last-child {
  margin-bottom: 0;
}

.team-card__note {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--accent-dark);
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

.values-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .values-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.values-list li {
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.values-list strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-weight: 600;
}

.contact-info {
  padding: 2rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--sky-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.contact-info h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.contact-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-list strong {
  min-width: 5.5rem;
  font-weight: 600;
  color: var(--text);
}

.contact-list a {
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

.support-note {
  padding: 1.75rem;
  background: var(--warm-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.support-note h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.support-note p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.support-note p:last-child {
  margin-bottom: 0;
}

.support-note a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.support-note a:hover {
  text-decoration: underline;
}

/* Chat IoNova */

.chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bg-elevated);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-hover);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.chat-fab:hover {
  transform: translateY(-2px);
}

.chat-fab[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
}

.chat-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 201;
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 2rem));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--sky-soft) 100%);
  border-bottom: 1px solid var(--border);
}

.chat-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.chat-header p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.chat-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.chat-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.chat-notice {
  flex: 1;
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-notice[hidden] {
  display: none;
}

.chat-notice__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.chat-notice__body {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.chat-notice__body p {
  margin: 0 0 0.65rem;
}

.chat-notice__body p:last-child {
  margin-bottom: 0;
}

.chat-notice__body a {
  color: var(--accent-dark);
  font-weight: 600;
}

.chat-notice__check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
}

.chat-notice__check input {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.chat-notice__btn {
  width: 100%;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg-elevated);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity var(--transition);
}

.chat-notice__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-notice__btn:not(:disabled):hover {
  background: var(--accent-dark);
}

.chat-messages {
  flex: 1;
  min-height: 12rem;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-messages[hidden],
.chat-footer[hidden] {
  display: none;
}

.chat-msg {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  border-radius: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg--assistant {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--text);
  border-bottom-left-radius: 0.25rem;
}

.chat-msg--user {
  align-self: flex-end;
  background: var(--accent-dark);
  color: var(--bg-elevated);
  border-bottom-right-radius: 0.25rem;
}

.chat-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
}

.chat-form input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
}

.chat-form input:focus {
  border-color: var(--accent);
}

.chat-form button[type="submit"] {
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg-elevated);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.chat-form button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-summary-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: transparent;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

.chat-summary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-status {
  min-height: 1.25rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Pagine legali */

.legal-content {
  max-width: 42rem;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.legal-content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.legal-content p {
  margin: 0 0 1rem;
}

.legal-content ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal-content a {
  color: var(--accent-dark);
  font-weight: 500;
}

.legal-notice {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin: 0.75rem 0 0;
}

.footer-legal a {
  font-size: 0.85rem;
  color: var(--moon-mid);
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--bg-elevated);
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  max-width: 36rem;
  margin-inline: auto;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
}

.cookie-banner p {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cookie-banner a {
  color: var(--accent-dark);
  font-weight: 500;
}

@media (min-width: 700px) {
  .cookie-banner {
    inset: auto 1.5rem 1.5rem 1.5rem;
    margin-left: auto;
    margin-right: 0;
  }
}

/* Diventa socio */

.membership-layout {
  max-width: 52rem;
}

.membership-steps {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 700px) {
  .membership-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.membership-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.membership-step:hover,
.membership-step.is-active {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.membership-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
}

.membership-status {
  min-height: 1.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.membership-status--ok {
  color: #2d6a4f;
}

.membership-status--warn {
  color: #9a6700;
}

.membership-status--error {
  color: #b42318;
}

.membership-panel {
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.membership-panel__header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.membership-panel__header p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.consent-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.membership-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.membership-form input,
.membership-form select,
.membership-form textarea {
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.membership-form input:focus,
.membership-form select:focus,
.membership-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-grid__full {
  grid-column: 1 / -1;
}

.membership-fieldset {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.membership-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

.membership-radio,
.membership-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
}

.membership-radio input,
.membership-check input {
  width: auto;
  margin-top: 0.2rem;
}

.membership-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.membership-card-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .membership-card-layout {
    grid-template-columns: 1fr 1.1fr;
    align-items: start;
  }
}

.membership-card-preview-wrap {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.membership-card-preview-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.membership-card-preview {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.membership-gate__panel {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.membership-gate__panel h2 {
  margin: 0 0 0.5rem;
}

.membership-gate__panel p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.membership-gate__status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: #b42318;
}

.membership-app-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
