/* ===== MODAL OVERLAY ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.463);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease forwards;
  }
  
  /* ===== MODAL BOX ===== */
  .modal-content {
    width: 100%;
    max-width: 420px;
    background: var(--c-glass-bg);
    color: #fff;
    border-radius: 14px;
    padding: 28px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    animation: scaleIn 0.35s ease forwards;
  }
  
  /* ===== CLOSE BUTTON ===== */
  .modal-content span {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 26px;
    cursor: pointer;
    opacity: 0.8;
  }
  .modal-content span:hover {
    opacity: 1;
  }
  
  /* ===== FORM ===== */
  .modal-content h2 {
    margin-bottom: 20px;
    text-align: center;
  }
  
  .modal-content label {
    font-size: 0.9rem;
    opacity: 0.85;
  }
  
  .modal-content input {
    width: 100%;
    padding: 10px 12px;
    margin: 6px 0 16px;
    border-radius: 6px;
    border: none;
    outline: none;
    background: #2a2a2a;
    color: #fff;
  }
  
  .modal-content button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: var(--c-brand-navy);
    color: var(--text-white);
    font-weight: 600;
    font-size: 1rem;
  }
  
  .modal-content button:hover {
    opacity: 0.9;
  }
  
  /* ===== SWITCH LINK ===== */
  .modal-switch {
    margin-top: 14px;
    text-align: center;
    font-size: 0.9rem;
  }
  
  .modal-switch a {
    color: #00adb5;
    cursor: pointer;
    text-decoration: none;
  }
  
  .modal-switch a:hover {
    text-decoration: underline;
  }

  /* ===== SCROLLABLE CONTENT ===== */
.modal-scroll {
    max-height: 90vh;
    overflow-y: auto;
  }
  
  /* ===== BENEFITS ===== */
  .benefits-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
  }
  
  .benefits-list li {
    padding-left: 22px;
    margin-bottom: 6px;
    position: relative;
    font-size: 0.9rem;
  }
  
  .benefits-list li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: #4da3ff;
  }
  
  /* ===== TERMS ===== */
  .terms-title {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 12px;
  }
  
  .terms-box {
    max-height: 120px;
    overflow-y: auto;
    background: #2a2a2a;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-bottom: 14px;
  }
  
  /* ===== RECAPTCHA CENTER ===== */
  .g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 18px 0;
  }
  
  
  /* ===== ANIMATIONS ===== */
  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  
  @keyframes scaleIn {
    from {
      opacity: 0;
      transform: scale(0.92) translateY(10px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  } 


  /* ===== FORM ERROR ===== */
.form-error {
    background: rgba(224, 16, 16, 0.75);
    color: #ffffff;
    border: 1px solid rgba(220, 53, 69, 0.4);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    animation: shake 0.35s ease;
  }

  .form-success {
    background: rgba(26, 143, 3, 0.75);
    color: #ffffff;
    border: 1px solid rgba(100, 220, 53, 0.4);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    animation: shake 0.35s ease;
  }
  
  /* ===== SHAKE ANIMATION ===== */
  @keyframes shake {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-4px); }
    50%  { transform: translateX(4px); }
    75%  { transform: translateX(-4px); }
    100% { transform: translateX(0); }
  }
  
  .flash-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
  }
  
  .flash-message.error {
    background-color: #ffe0e0;
    color: red;
    border: 1px solid red;
  }
  
  .flash-message.success {
    background-color: #e0ffe0;
    color: green;
    border: 1px solid green;
  }
  


/* ==========================================================================
   PANNELLO UTILITY STICKY (IN ALTO A DESTRA DELLA SCHERMATA)
   ========================================================================== */
.sticky-utility-panel {
    position: fixed !important;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 9999; /* Sotto il blackout della modale (9999) ma sopra al sito */
    pointer-events: none; /* Evita di bloccare i click di elementi sottostanti */
}

/* Stile base comune per i due riquadri */
.sticky-box {
    pointer-events: auto; /* Riattiva i click sui singoli riquadri */
    background: var(--bg-card, #1e1e1e);
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sticky-box:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    background: #252525;
}

/* Icone all'interno dei riquadri */
.sticky-icon {
    font-size: 1.2rem;
    line-height: 1;
}

/* Testo del riquadro Dashboard */
.sticky-text {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Contatore dinamico rosso/arancione per il Carrello */
.cart-counter {
    background: #ff5b5b; /* Colore di avviso vivido */
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1;
    min-width: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: popIn 0.3s ease forwards;
}

/* Semplice animazione di comparsa per il contatore */
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Assicurati che .modal non abbia regole !important che blocchino il display flex impostato da JS */