body {
  font-family: Arial, sans-serif;
  background-color: #f2f2f2;
  margin: 0;
  padding: 0;
  
  display: flex;
  justify-content: center;
  align-items: flex-start; /* ⬅️ cambia questo */

  min-height: 100vh; /* ⬅️ invece di height */
}

.container {
  background-color: #f2f2f2;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  max-width: 440px;
  text-align: center;
  font-family: "Alata", sans-serif;
  margin: auto;
  overflow-y: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.container {
  display: block;
  animation: fadeIn 0.5s ease;
}

.container img {
  width: 50%;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

h2 {
  color: #FF7200;
  margin-top: 20px;
  margin-bottom: 10px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
}

h3 {
  color: #23bb11;
  text-align: center;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #064BE0;
  text-align: left;
  font-size: 18px;
  margin-left: 20px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: calc(100% - 22px);
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 18px;
  font-family: "Alata", sans-serif;
  color: #064BE0;
  margin-bottom: 20px;
}

textarea {
  font-size: 16px;
  width: 90%;
  height: 120px;
  font-family: 'Alata', sans-serif;
  border-radius: 6px;
  border: 1px solid #ccc;
  color: #333;
  padding: 5px 10px;
}

#message::placeholder {
  font-style: italic;
}

button[type="submit"],
button,
.button-link {
  width: calc(100% - 20px);
  padding: 10px;
  background-color: #064be0;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  font-family: "Alata", sans-serif;
  margin-top: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button[type="submit"]:hover,
button:hover,
.button-link:hover {
  background-color: #333;
  color: white;
}

.button-separator {
  border-bottom: 1px solid #23bb11;
  margin: 20px auto;
  width: 80%;
}

.button-link {
  display: block;
  
  padding: 10px;
  border-radius: 4px;
  background-color: #064be0;
  color: white;
  font-size: 18px;
  cursor: pointer;
  font-family: "Alata", sans-serif;
  text-align: center;
  text-decoration: none;
  
}

.button-link:hover {
  background-color: #333;
}

a.button-link {
    width: calc(100% - 40px);
  display: block;
  padding: 10px;
  border-radius: 4px;
  background-color: #23bb11;
  color: white;
  font-size: 18px;
  font-family: "Alata", sans-serif;
  text-align: center;
  text-decoration: none;
  margin: 20px auto 0;
}

a.button-link:hover {
  background-color: #333;
}

@media (max-width: 768px) {
  #card_message_preview {
    font-size: 28px;
    line-height: 1.1;
  }
}


table {
  width: calc(100% - 20px);
  border-collapse: collapse;
  margin: 20px auto 0;
}

th,
td {
  padding: 10px;
  font-size: 18px;
}

th {
  background-color: #333333;
  color: #fff;
  font-weight: normal;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

.logolink {
  float: right;
}

.fab.fa-whatsapp {
  color: #23bb11;
  font-size: 24px;
}

.fas.fa-qrcode {
  color: #064be0;
  font-size: 24px;
}

.far.fa-credit-card {
  color: #FE7409;
  font-size: 24px;
}

.confirmation-message {
  color: #23bb11;
  font-weight: normal;
  margin-top: 10px;
  font-size: 20px;
}

.already-redeemed {
  color: #FE7409;
  font-weight: bold;
}

.codice-tooltip {
  text-decoration: underline;
  cursor: pointer;
}

.tooltip {
  background: #333;
  font-family: Alata, sans-serif;
  color: #fff;
  padding: 5px;
  border-radius: 5px;
  position: absolute;
  z-index: 2;
}

.registrazione {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

.esci {
  text-decoration: none;
}

.esci button {
  background-color: #FE7409;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
}

.esci button:hover {
  background-color: #333;
}

#image_preview {
  position: relative;
  width: 400px;
  margin: 20px auto;
  text-align: center;
}

#preview_img {
  width: 100%;
  border-radius: 8px;
}

.grecaptcha-badge {
  opacity: 0;
}

#recaptcha-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 5px;
  padding: 10px;
  text-align: center;
  margin-top: 10px;
  display: none;
  color: #721c24;
}

.search-bar {
  margin-bottom: 20px;
}

.search-bar input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 30px;
}

.activity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.activity:hover {
  background-color: #f5f5f5;
}

.activity-details {
  flex: 1;
  margin-right: 15px;
  text-align: left;
}

.activity-details b {
  font-size: 18px;
  color: #064BE0;
  font-weight: normal;
}

.activity-details p {
  margin: 0;
}

.activity-details .categoria {
  color: #fec000;
}

.activity-logo-container {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #f9f9f9;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #ddd;
  padding: 0px;
  box-sizing: border-box;
}

.activity-logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.no-select,
.no-select * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
}

.btn-whatsapp {
  background-color: #25D366 !important;
  color: white !important;
}

.btn-stampa {
  background-color: #007bff !important;
  color: white !important;
}

.btn-salva {
  background-color: #FEC000 !important;
  color: white !important;
}

#loading {
    font-size: 16px;
    color: #555;
}


/* Effetto di sfondo sfocato */
#videoPopup {
    backdrop-filter: blur(8px); /* Sfoca lo sfondo */
}

/* Animazioni per apertura e chiusura */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

#videoPopup.open {
    animation: fadeIn 0.3s ease forwards;
}

#videoPopup.close {
    animation: fadeOut 0.3s ease forwards;
}

#errorModal {
    display: none !important;
}

.error-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: white;
        color: black;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        text-align: center;
        display: none;
    }

    .error-popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .error-popup button {
        margin-top: 10px;
        padding: 8px 16px;
        background-color: red;
        color: white;
        border: none;
        cursor: pointer;
        border-radius: 5px;
    }
 

.desktop-layout {
  width: 100%;
}

.preview-container {
  display: none;
}

.preview-heading {
  text-align: center;
  margin-bottom: 18px;
}

.preview-panel-title {
  font-family: "Alata", sans-serif;
  font-size: 24px;
  color: #333;
  margin-bottom: 6px;
}

.preview-panel-subtitle {
  font-family: "Alata", sans-serif;
  font-size: 32px;
  line-height: 1.2;
  color: #23bb11;
  margin-bottom: 0;
}

.mobile-preview-heading {
  display: block;
  margin-top: 10px;
}

@media (min-width: 992px) {
  .mobile-preview-heading {
    display: none !important;
  }

  .desktop-preview-heading {
    display: block;
  }

  body {
    display: block;
    height: auto;
    min-height: 100vh;
    padding: 24px;
    box-sizing: border-box;
    align-items: flex-start;
  }

  .desktop-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 28px;
    align-items: stretch;
    justify-content: center;
  }

  /* Limita l'espansione full-width solo alle pagine con layout desktop a 2 colonne */
  .desktop-layout .container {
    margin: 0;
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  /* Mantiene i contenitori standard racchiusi anche su desktop */
  body:not(.homepage-body):not(.paypal-page):not(.cash-summary-page) > .container {
    width: min(100%, 1180px);
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
    overflow-x: auto;
  }

  .form-container {
    flex: 0 0 48%;
    max-width: 560px;
  }

  .preview-container {
    flex: 0 0 42%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 28px;
  }

  .desktop-preview-card {
    width: 100% !important;
    max-width: 480px;
    margin: 0 auto;
  }

  .form-container .container img,
  .preview-container img#preview_img {
    width: 100%;
  }

  .form-container > form > div > a img {
    width: 50%;
  }
}

@media (max-width: 991px) {
  .desktop-preview-heading {
    display: none !important;
  }

  .mobile-preview-heading {
    display: block;
  }

  .desktop-layout {
    display: block;
  }

  .preview-container {
    display: none !important;
  }
}

.mobile-preview-card {
  margin: 20px auto;
}

@media (min-width: 992px) {
  .mobile-preview-card {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .mobile-preview-card {
    display: block !important;
  }
}


/* Desktop vs Mobile visibility */
.desktop-only { display: none; }
.mobile-only { display: block; }

@media (min-width: 769px) {
  .desktop-only { display: block; }
  .mobile-only { display: none; }
}

/* Title styles */
.green-title { color: #23bb11; font-weight: 700; }

.desktop-only:first-child {
  font-size: 14px;
  color: #555;
}


/* --- Final preview heading fixes --- */
.preview-heading {
  text-align: center;
}

.preview-panel-title {
  font-family: "Alata", sans-serif;
  font-weight: 700;
  color: #3b3b3b !important;
}

.preview-panel-subtitle {
  font-family: "Alata", sans-serif;
  font-weight: 700;
  color: #3b3b3b;
}

.preview-panel-subtitle.green-title {
  color: #23bb11 !important;
}

.desktop-preview-heading {
  display: none;
}

.mobile-preview-heading {
  display: block;
}

@media (min-width: 992px) {
  .mobile-preview-heading {
    display: none !important;
  }

  .desktop-preview-heading {
    display: block !important;
    margin-bottom: 18px;
  }

  .desktop-preview-heading .preview-panel-title {
    font-size: 14px !important;
    line-height: 1.2;
    color: #5a5a5a !important;
    margin-bottom: 6px;
  }

  .desktop-preview-heading .preview-panel-subtitle {
    font-size: 24px !important;
    line-height: 1.15;
    margin-bottom: 0;
  }
}

@media (max-width: 991px) {
  .desktop-preview-heading {
    display: none !important;
  }

  .mobile-preview-heading {
    display: block !important;
    margin: 18px 0 10px;
  }

  .mobile-preview-heading .preview-panel-title {
    font-size: 14px !important;
    line-height: 1.2;
    color: #5a5a5a !important;
    margin-bottom: 6px;
  }

  .mobile-preview-heading .preview-panel-subtitle {
    font-size: 22px !important;
    line-height: 1.15;
    margin-bottom: 0;
  }
}


/* ===== Homepage responsive layout ===== */
.homepage-body {
  display: block;
  height: auto;
  min-height: 100vh;
  align-items: flex-start;
}

.homepage-shell {
  width: min(1180px, calc(100% - 32px));
  max-width: 1180px;
  margin: 14px auto 24px;
  padding: 16px;
  box-sizing: border-box;
}

.homepage-intro {
  text-align: justify;
  font-size: 18px;
  color: #333;
  margin-top: 30px;
  line-height: 1.6;
}

.homepage-intro-highlight {
  color: #064be0;
}

.homepage-intro-cta {
  color: #064be0;
  font-size: 20px;
  display: block;
  text-align: center;
}

.homepage-activities-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background-color: #f9f9f9;
  padding: 10px;
  box-sizing: border-box;
}

.homepage-activities-grid .activity {
  margin-bottom: 0;
  min-height: 116px;
}

footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  max-width: 1180px;
  background-color: #f0f0f0;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-family: "Alata", sans-serif;
  color: #333;
  box-sizing: border-box;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.whatsapp-btn {
  position: fixed;
  bottom: 59px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  max-width: 1180px;
  background-color: #25d366;
  color: white;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  padding: 10px 20px;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .homepage-shell {
    padding: 22px 28px 24px;
  }

  .homepage-shell > div > a img {
    width: 260px;
    max-width: 100%;
  }

  .homepage-activities-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    padding: 18px;
    margin-bottom: 120px;
  }

  .homepage-activities-grid .activity {
    padding: 18px 20px;
    border-radius: 16px;
    min-height: 130px;
  }

  .homepage-activities-grid .activity-details b {
    font-size: 20px;
    font-weight: 400;
  }

  .homepage-activities-grid .activity-details p {
    font-size: 18px;
    line-height: 1.45;
  }

  .homepage-activities-grid .activity-logo-container {
    width: 108px;
    height: 108px;
    flex: 0 0 108px;
  }
}

@media (max-width: 991px) {
  .homepage-shell {
    width: min(440px, calc(100% - 20px));
    max-width: 440px;
    padding: 10px;
  }

  footer {
    width: min(440px, calc(100% - 20px));
  }

  .whatsapp-btn {
    width: min(440px, calc(100% - 20px));
  }

  .homepage-activities-grid {
    margin-bottom: 110px;
  }
}


/* --- Intro improvements --- */
.homepage-intro-centered {
  text-align: center;
}

.homepage-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 18px;
  margin-top: 10px;
}

.homepage-steps i {
  margin-right: 6px;
  color: #064be0;
}

/* Desktop version of steps */
@media (min-width: 992px) {
  .homepage-steps {
    flex-direction: row;
    justify-content: center;
    gap: 30px;
    font-size: 18px;
  }
}

/* Hover modern effect */
.activity {
  transition: all 0.2s ease;
}

.activity:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

/* Slight spacing optimization */
.homepage-intro {
  margin-bottom: 20px;
}


/* --- Activity micro-interactions --- */
.activity-card {
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
}

.activity-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(6,75,224,0) 0%, rgba(6,75,224,0.06) 50%, rgba(6,75,224,0) 100%);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
  pointer-events: none;
}

.activity-card:hover::after {
  transform: translateX(120%);
}

.activity-card:active,
.activity-card.is-clicked {
  transform: scale(0.985);
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}

.activity-card .activity-logo-container {
  transition: transform 0.25s ease;
}

.activity-card:hover .activity-logo-container {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .activity,
  .activity-card,
  .activity-card::after,
  .activity-card .activity-logo-container {
    transition: none !important;
  }
}


/* ===== Buonopaypal page: keep card contained on desktop like mobile ===== */
.paypal-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: auto;
  min-height: 100vh;
  padding: 24px 12px;
  box-sizing: border-box;
}

.paypal-page .paypal-container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  overflow: visible;
}

.paypal-page .paypal-container > div > img:first-child {
  width: 50%;
  max-width: 280px;
}

.paypal-page .img {
  text-align: center;
}

.paypal-page #buonoImg {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 20px auto !important;
  border-radius: 12px;
}

.paypal-page .paypal-buttons {
  flex-wrap: wrap;
}

.paypal-page .paypal-buttons .btn {
  flex: 1 1 150px;
  min-width: 0;
}

@media (min-width: 992px) {
  .paypal-page {
    padding: 40px 16px;
  }

  .paypal-page .paypal-container {
    max-width: 640px;
    padding: 28px 28px 24px;
  }

  .paypal-page .info p {
    text-align: center !important;
    font-size: 18px !important;
  }

  .paypal-page .paypal-buttons {
    gap: 10px;
    justify-content: center !important;
  }

  .paypal-page .paypal-buttons .btn {
    flex: 1 1 0;
    max-width: 180px;
    margin-top: 0;
  }

  .paypal-page .footer p {
    text-align: center !important;
  }
}

@media (max-width: 991px) {
  .paypal-page {
    padding: 12px;
  }

  .paypal-page .paypal-container {
    max-width: 440px;
  }

  .paypal-page .paypal-buttons .btn {
    flex: 1 1 100%;
  }
}


/* ===== Buonocassa page: keep summary contained on desktop like mobile ===== */
.cash-summary-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: auto;
  min-height: 100vh;
  padding: 24px 12px;
  box-sizing: border-box;
}

.cash-summary-page .cash-summary-container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  overflow: visible;
}

.cash-summary-page .cash-summary-container > div > img:first-child {
  width: 50%;
  max-width: 280px;
}

.cash-summary-page .info p,
.cash-summary-page .cash-summary-container h3,
.cash-summary-page .cash-summary-container p {
  word-break: break-word;
}

.cash-summary-page .cash-summary-save {
  width: calc(100% - 20px);
}

@media (min-width: 992px) {
  .cash-summary-page {
    padding: 40px 16px;
  }

  .cash-summary-page .cash-summary-container {
    max-width: 640px;
    padding: 28px 28px 24px;
  }
}

@media (max-width: 991px) {
  .cash-summary-page {
    padding: 12px;
  }

  .cash-summary-page .cash-summary-container {
    max-width: 440px;
  }
}
