/* ============================================================
   Rappel — Landing page
   CSS custom sopra Bootstrap 5. Palette e vincoli: vedi rappel.md
   ============================================================ */

:root {
  --notte: #17324D;        /* autorevolezza, titoli */
  --salvia: #5D8C7B;       /* serenità, dettagli e icone */
  --salvia-scuro: #3E6355; /* variante salvia con contrasto AA su bianco */
  --crema: #F7F3EA;        /* fondi caldi */
  --corallo: #E76F51;      /* accenti decorativi e testi grandi */
  --corallo-cta: #BF4A2A;  /* CTA: contrasto >= 4.5:1 con testo bianco */
  --corallo-cta-hover: #A23E23;
  --testo: #1F2933;
  --testo-soft: #52606D;
  --bianco: #FFFFFF;
  --su-notte: #E4EAF1;     /* testo su fondo blu notte */
  --errore: #B02A37;
  --radius: 1rem;
  --shadow-card: 0 6px 24px rgba(23, 50, 77, 0.08);
}

/* ---------- Base ---------- */

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 1.0625rem;            /* 17 px su mobile */
  line-height: 1.6;
  color: var(--testo);
  background-color: var(--bianco);
}

@media (min-width: 768px) {
  body {
    font-size: 1.125rem;           /* 18 px da tablet in su */
  }
}

h1, h2, h3, h4, h5, h6 {
  color: var(--notte);
  font-weight: 700;
  line-height: 1.2;
}

p {
  max-width: 70ch;                 /* righe leggibili */
}

a {
  color: var(--notte);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--corallo-cta);
}

/* Ancore: compensa l'header sticky */
[id] {
  scroll-margin-top: 92px;
}

/* Focus sempre visibile */
:focus-visible {
  outline: 3px solid var(--notte);
  outline-offset: 2px;
  border-radius: 4px;
}

.bg-notte :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--crema);
}

/* Contenitore: larghezza massima leggibile su desktop ampi */
@media (min-width: 1400px) {
  .container {
    max-width: 1200px;
  }
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  padding: 0.75rem 1.25rem;
  background: var(--notte);
  color: var(--bianco);
  border-radius: 0 0 0.5rem 0.5rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: var(--bianco);
}

/* ---------- Pulsanti ---------- */

.btn {
  min-height: 44px;                /* touch target */
  border-radius: 0.75rem;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
}

.btn-cta {
  background-color: var(--corallo-cta);
  border: 2px solid var(--corallo-cta);
  color: var(--bianco);
}

.btn-cta:hover {
  background-color: var(--corallo-cta-hover);
  border-color: var(--corallo-cta-hover);
  color: var(--bianco);
}

.btn-cta:focus-visible {
  background-color: var(--corallo-cta-hover);
  color: var(--bianco);
}

.btn-cta:active {
  background-color: var(--notte) !important;
  border-color: var(--notte) !important;
  color: var(--bianco) !important;
}

.btn-cta:disabled {
  background-color: var(--corallo-cta);
  border-color: var(--corallo-cta);
  color: var(--bianco);
  opacity: 0.65;
}

.btn-outline-notte {
  border: 2px solid var(--notte);
  color: var(--notte);
  background: transparent;
}

.btn-outline-notte:hover,
.btn-outline-notte:active {
  background-color: var(--notte);
  color: var(--bianco);
}

/* ---------- Header ---------- */

.site-header {
  background: var(--bianco);
  border-bottom: 1px solid rgba(23, 50, 77, 0.08);
  transition: box-shadow 0.25s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 18px rgba(23, 50, 77, 0.12);
}

.site-header .navbar {
  padding-block: 0.5rem;
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
}

.site-header .nav-link {
  color: var(--notte);
  font-weight: 600;
  padding: 0.65rem 0.9rem;         /* touch target ampio */
  border-radius: 0.5rem;
}

.site-header .nav-link:hover {
  color: var(--corallo-cta);
  background: var(--crema);
}

/* Hamburger custom: due linee spesse che si trasformano in una X */

.navbar-toggler.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
}

.navbar-toggler.menu-toggle:focus {
  box-shadow: none;
}

.navbar-toggler.menu-toggle:focus-visible {
  outline: 3px solid var(--notte);
  outline-offset: 2px;
}

.menu-toggle-bar {
  display: block;
  width: 28px;
  height: 3px;                     /* spigoli netti, nessun arrotondamento */
  background: var(--notte);
  transition: transform 0.28s cubic-bezier(0.85, 0, 0.15, 1);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* Da desktop in su l'hamburger resta nascosto (ripristina Bootstrap) */
@media (min-width: 992px) {
  .navbar-toggler.menu-toggle {
    display: none;
  }
}

.btn-nav-cta {
  padding: 0.5rem 1.1rem;
}

/* Menu mobile a tutta altezza, apertura con taglio diagonale */

body.menu-open {
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    position: fixed;
    top: var(--header-h, 61px);
    left: 0;
    right: 0;
    height: calc(100dvh - var(--header-h, 61px)) !important;
    background: linear-gradient(170deg, var(--notte) 0%, #10263C 100%);
    padding: 1.5rem 1.5rem 3rem;
    overflow-y: auto;
    transition: none;
  }

  .site-header .navbar-collapse.show {
    animation: menu-cut 0.4s cubic-bezier(0.85, 0, 0.15, 1) both;
  }

  .site-header .navbar-collapse .nav-link {
    color: var(--crema);
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid rgba(247, 243, 234, 0.15);
    border-radius: 0;
  }

  .site-header .navbar-collapse .nav-link:hover,
  .site-header .navbar-collapse .nav-link:focus-visible {
    color: var(--corallo);
    background: transparent;
  }

  .site-header .navbar-collapse :focus-visible {
    outline-color: var(--crema);
  }

  .site-header .navbar-collapse .btn-nav-cta {
    display: block;
    width: 100%;
    margin-top: 2rem;
    padding: 0.9rem 1.25rem;
    font-size: 1.15rem;
  }

  .site-header .navbar-collapse.show .nav-item,
  .site-header .navbar-collapse.show .btn-nav-cta {
    animation: menu-item-in 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }

  .site-header .navbar-collapse.show .nav-item:nth-child(1) { animation-delay: 0.12s; }
  .site-header .navbar-collapse.show .nav-item:nth-child(2) { animation-delay: 0.18s; }
  .site-header .navbar-collapse.show .nav-item:nth-child(3) { animation-delay: 0.24s; }
  .site-header .navbar-collapse.show .nav-item:nth-child(4) { animation-delay: 0.3s; }
  .site-header .navbar-collapse.show .btn-nav-cta { animation-delay: 0.38s; }
}

@keyframes menu-cut {
  0% { clip-path: polygon(0 0, 100% 0, 100% 0%, 0 0%); }
  55% { clip-path: polygon(0 0, 100% 0, 100% 76%, 0 34%); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

@keyframes menu-item-in {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sezioni ---------- */

.section {
  padding-block: 3.5rem;
}

@media (min-width: 992px) {
  .section {
    padding-block: 5rem;
  }
}

.bg-crema {
  background-color: var(--crema);
}

.section-intro {
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
  margin-bottom: 2rem;
}

.section-intro p {
  margin-inline: auto;
}

h2 {
  font-size: clamp(1.65rem, 3.2vw, 2.3rem);
  margin-bottom: 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--salvia-scuro);
  margin-bottom: 0.75rem;
}

.microcopy {
  font-size: 0.95rem;
  color: var(--testo-soft);
}

.microcopy.on-dark {
  color: #C3CFDC;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--crema) 0%, var(--bianco) 100%);
  padding-block: 3rem 3.5rem;
}

@media (min-width: 992px) {
  .hero {
    padding-block: 5rem 5.5rem;
  }
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  line-height: 1.12;
  margin-bottom: 1rem;
}

.lead-text {
  font-size: 1.25rem;
  max-width: 36rem;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--notte);
}

.trust-strip li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.trust-strip svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--salvia-scuro);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Visual illustrativo */

.hero-visual {
  position: relative;
  background: linear-gradient(160deg, #E7EFEA 0%, #F2EDE1 100%);
  border-radius: 1.5rem;
  padding: 2.5rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
}

.hero-device svg {
  display: block;
  filter: drop-shadow(0 8px 16px rgba(23, 50, 77, 0.18));
}

.chat-balloon {
  background: var(--bianco);
  border-radius: 1.1rem;
  padding: 0.8rem 1.1rem;
  max-width: 90%;
  box-shadow: 0 4px 14px rgba(23, 50, 77, 0.1);
  font-size: 1rem;
}

.balloon-person {
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
}

.balloon-rappel {
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
  background: #EDF3F0;
}

.balloon-author {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--salvia-scuro);
  margin-bottom: 0.15rem;
}

.visual-note {
  font-size: 0.85rem;
  color: var(--testo-soft);
  margin: 0;
}

/* ---------- Card informative ---------- */

.info-card,
.feature-card {
  border: 1px solid rgba(23, 50, 77, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.info-card .card-body,
.feature-card .card-body {
  padding: 1.5rem;
}

.info-card h3 {
  margin-bottom: 0.5rem;
}

/* ---------- Come funziona ---------- */

.steps-list {
  counter-reset: step;
  margin-bottom: 0;
}

.step-card {
  background: var(--crema);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--notte);
  color: var(--crema);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ---------- Demo conversazionale ---------- */

.demo-box {
  max-width: 680px;
  background: var(--bianco);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .demo-box {
    padding: 2rem;
  }
}

.demo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.demo-play-icon {
  margin-right: 0.4rem;
}

.badge-ai {
  background: var(--notte);
  color: var(--crema);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.demo-chat {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.chat-row {
  display: flex;
}

.chat-rappel {
  justify-content: flex-start;
}

.chat-person {
  justify-content: flex-end;
}

.chat-bubble {
  margin: 0;
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: 1.1rem;
  font-size: 1.02rem;
}

.chat-rappel .chat-bubble {
  background: var(--crema);
  border-bottom-left-radius: 0.25rem;
}

.chat-person .chat-bubble {
  background: #E3EDE8;
  border-bottom-right-radius: 0.25rem;
}

.chat-name {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--salvia-scuro);
  margin-bottom: 0.2rem;
}

/* Animazione demo (gestita da JS, disattivata con reduced motion) */
.demo-chat .chat-row {
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.demo-chat.demo-anim .chat-row {
  opacity: 0;
  transform: translateY(10px);
}

.demo-chat.demo-anim .chat-row.shown {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  #demoPlayBtn {
    display: none;                 /* la trascrizione resta sempre visibile */
  }
}

/* ---------- Funzionalità ---------- */

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--crema);
  margin-bottom: 1rem;
  color: var(--salvia-scuro);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Doppio beneficio (fondo blu notte) ---------- */

.bg-notte {
  background-color: var(--notte);
}

.bg-notte h2,
.bg-notte h3 {
  color: var(--bianco);
}

.bg-notte p,
.bg-notte li {
  color: var(--su-notte);
}

.benefit-col {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
}

.benefit-col h3 {
  margin-bottom: 1rem;
}

.check-list {
  margin: 0;
}

.check-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
}

.check-list li:last-child {
  margin-bottom: 0;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 1.15em;
  height: 1.15em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8CBBB' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ---------- Privacy e fiducia ---------- */

.trust-card {
  background: var(--crema);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.trust-card .feature-icon {
  background: var(--bianco);
}

.trust-card p {
  font-weight: 600;
  color: var(--notte);
  margin-inline: auto;
}

.disclaimer-note {
  max-width: 52rem;
  margin-inline: auto;
  background: var(--crema);
  border-left: 5px solid var(--salvia);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
}

.disclaimer-note p {
  margin-inline: auto;
  color: var(--testo);
}

/* ---------- Form candidatura ---------- */

.form-shell {
  max-width: 720px;
  background: var(--bianco);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .form-shell {
    padding: 2.5rem;
  }
}

.form-progress {
  margin-bottom: 1.75rem;
}

.step-indicator {
  font-weight: 600;
  color: var(--notte);
  margin-bottom: 0.5rem;
}

.progress {
  height: 10px;
  background-color: #E9E4D8;
  border-radius: 999px;
}

.progress-bar {
  background-color: var(--salvia-scuro);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.step-title {
  margin-bottom: 1.5rem;
}

.step-title:focus {
  outline: none;                   /* focus programmatico, senza anello */
}

.form-label,
fieldset legend.form-label {
  font-weight: 600;
  color: var(--notte);
  font-size: 1.02rem;
  margin-bottom: 0.5rem;
}

.req {
  color: var(--corallo-cta);
  font-weight: 700;
}

.hint {
  font-weight: 400;
  color: var(--testo-soft);
  font-size: 0.92rem;
}

.form-hint {
  font-size: 0.92rem;
  color: var(--testo-soft);
  margin: 0.35rem 0 0;
}

.form-control,
.form-select {
  font-size: 1rem;                 /* mai sotto i 16 px nei campi */
  min-height: 48px;
  border-radius: 0.65rem;
  border: 1.5px solid rgba(23, 50, 77, 0.35);
  color: var(--testo);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--salvia-scuro);
  box-shadow: 0 0 0 0.25rem rgba(93, 140, 123, 0.3);
}

.form-check {
  padding-block: 0.3rem;           /* touch target più ampio */
}

.form-check-input {
  width: 1.35em;
  height: 1.35em;
  margin-top: 0.18em;
  border: 1.5px solid rgba(23, 50, 77, 0.45);
}

.form-check-input:checked {
  background-color: var(--salvia-scuro);
  border-color: var(--salvia-scuro);
}

.form-check-input:focus {
  border-color: var(--salvia-scuro);
  box-shadow: 0 0 0 0.25rem rgba(93, 140, 123, 0.3);
}

.form-check-label {
  padding-left: 0.25rem;
}

.invalid-feedback {
  color: var(--errore);
  font-size: 0.92rem;
}

.form-control.is-invalid,
.form-select.is-invalid,
.form-check-input.is-invalid {
  border-color: var(--errore);
}

.form-error-summary {
  border-radius: 0.75rem;
}

.form-error-summary ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.consent-box {
  background: var(--crema);
  border-radius: 0.85rem;
  padding: 1.25rem 1.25rem 1rem;
  margin-top: 1.5rem;
}

/* Honeypot: invisibile per le persone, presente per i bot */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.form-nav .btn {
  min-width: 130px;
}

.form-nav #btnAvanti,
.form-nav #btnInvia {
  margin-left: auto;
}

.form-success {
  padding: 2rem 1rem;
}

.form-success:focus {
  outline: none;
}

.success-icon svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--salvia-scuro);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- FAQ ---------- */

.faq-accordion {
  max-width: 800px;
}

.accordion-item {
  border: 1px solid rgba(23, 50, 77, 0.12);
}

.accordion-button {
  font-weight: 600;
  color: var(--notte);
  font-size: 1.05rem;
  padding: 1.1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
  background-color: var(--crema);
  color: var(--notte);
  box-shadow: inset 0 -1px 0 rgba(23, 50, 77, 0.12);
}

.accordion-button:focus {
  border-color: var(--salvia-scuro);
  box-shadow: 0 0 0 0.25rem rgba(93, 140, 123, 0.35);
}

.accordion-body {
  color: var(--testo);
}

/* ---------- CTA finale ---------- */

.cta-finale-text {
  max-width: 40rem;
  font-size: 1.15rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: #10263C;
  color: var(--su-notte);
  padding-block: 3rem 1.5rem;
}

.footer-logo-chip {
  display: inline-flex;
  background: var(--crema);
  border-radius: 0.85rem;
  padding: 0.6rem 1rem;
}

.footer-logo-chip img {
  display: block;
  height: 45px;
  width: auto;
}

.footer-text {
  color: var(--su-notte);
  font-size: 0.98rem;
}

.site-footer a {
  color: #CBD6E0;
}

.site-footer a:hover {
  color: var(--bianco);
}

.footer-heading {
  color: var(--bianco);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #CBD6E0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  cursor: pointer;
}

.footer-link-btn:hover {
  color: var(--bianco);
}

.footer-cookie-note {
  font-size: 0.9rem;
  color: #AAB8C6;
  margin-top: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  font-size: 0.9rem;
  color: #AAB8C6;
}

/* ---------- CTA sticky mobile ---------- */

.sticky-cta {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1030;
  background: var(--bianco);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(23, 50, 77, 0.18);
}

/* ---------- Riduzione del movimento ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
