/* Styles généraux et variables de thème */
:root {
  --primary-color: #FF9500;
  --second-color : #d68e29;
  --success-color: #4caf50;
  --danger-color: #f44336;
  --text-color: #333;
  --bg-color: #f9f9fc;
}
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
}

/* Empêche tout débordement */
*, *::before, *::after {
  box-sizing: border-box;
}

.modal-content.card {
  width: 100%;
  max-width: 350px;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.form-card {
  width: 100%;
  max-width: 320px;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
  margin: auto;
}

.form-card h2 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.4rem;
}

.form-card input,
.form-card button {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.form-card input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.form-card button {
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.form-card button:hover {
  background: var(--primary-color);
}

.form-switch {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-switch a {
  color: var(--primary-color);
  text-decoration: none;
}


/* Barre de navigation supérieure */
.topbar {
  background: var(--primary-color);
  color: #fff;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
}
.topbar .app-title {
  font-size: 1.2rem;
  margin: 0;
}
.topbar .user-info {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}
.topbar #user-status {
  margin-right: 1rem;
}
.topbar #login-btn-top,
.topbar #logout-btn {
  background: #fff;
  color: var(--primary-color);
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.topbar #login-btn-top:hover,
.topbar #logout-btn:hover {
  background: #eee;
}

/* Contenu principal */
.content {
  padding: 1rem;
}
.page {
  margin-bottom: 2rem;
}

/* Section Accueil (Bonus quotidien, Jeu, Actions, Coupons) */
#game-section {
  text-align: center;
  margin-bottom: 1rem;
}
#play-game {
  max-width: 100%;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s;
}
#play-game:hover {
  transform: scale(1.02);
}
.game-note {
  font-size: 0.9rem;
  color: #555;
}
#actions-list .action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 6px;
  padding: 0.5rem;
  margin: 0.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#actions-list .action-text {
  font-size: 0.95rem;
}
#actions-list .action-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  margin-bottom:5px;
  font-size: 0.9rem;
}
#actions-list .action-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}
/* Coupon card */
.coupon-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-color);
  color: #fff;
  border-radius: 12px;
  padding: 1rem;
  margin: 0.5rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Infos à gauche */
.coupon-info {
  flex: 1;
}
.coupon-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.coupon-expiry {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* QR à droite */
.coupon-qr-wrapper {
  flex-shrink: 0;
  margin-left: 1rem;
}
.coupon-qr {
  width: 80px;
  height: 80px;
  border: 3px solid #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}
.coupon-qr:hover {
  transform: scale(1.05);
}

/* Centre tout le contenu du modal */
#qr-modal .modal-content {
  text-align: center;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); /* clic arrière-plan détectable */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}


/* Transforme le badge code en block et centre-le */
.modal-code-box {
  display: block;
  margin: 0.5rem auto 1rem; /* 0.5 rem en haut, auto à gauche/droite, 1 rem en bas */
  color: var(--primary-color);         /* couleur principale */
  font-weight: 600;
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Modal plein écran QR */
#qr-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  background: rgba(0,0,0,0.6);
  z-index: 2000;
}
#qr-modal .modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
#qr-modal .modal-content h2 {
  margin-top: 0;
  color: var(--primary-color);
}
#qr-modal .modal-content img {
  max-width: 300px;
  max-height: 300px;
  margin: 1rem 0;
}
#qr-modal .modal-content .modal-expiry {
  font-size: 0.9rem;
  color: #555;
}


/* Section Historique */
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  margin: 0.3rem 0;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.9rem;
}
.history-list li .value {
  font-weight: bold;
}
.history-amount.positive {
  color: var(--success-color);
}
.history-amount.negative {
  color: var(--danger-color);
}
#offers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}
.card {
  background: white;
}

.offer.card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.offer.card:hover {
  transform: translateY(-4px);
}

.offer.card img {
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 0.3s;
  border-radius: 16px;
}

.offer.card .cost-circle {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: white;
  color: var(--primary-color);
  font-weight: bold;
  border-radius: 10%;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.offer.card .redeem-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.offer.card .redeem-btn:hover:not(:disabled) {
  background: var(--primary-color);
}

.offer.card .redeem-btn:disabled {
  background: #ddd;
  color: #888;
  cursor: not-allowed;
}


/* Section Profil */
.profile-field {
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
}
.profile-field label {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.profile-field input,
.profile-field select {
  padding: 0.4rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.profile-field input:disabled {
  background: #eee;
}
#profile-page button {
  margin: 0.5rem 0.2rem 0.5rem 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#save-profile-btn {
  background: var(--primary-color);
  color: #fff;
}
#prefs-btn,
#toggle-password-section {
  background: #ddd;
}
#password-section input {
  display: block;
  margin: 0.3rem 0;
  padding: 0.4rem;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#password-section button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  margin-top: 0.3rem;
  cursor: pointer;
}

/* Barre de navigation inférieure */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  display: flex;
  border-top: 1px solid #ccc;
  z-index:999;
}
.bottom-nav .nav-btn {
  flex: 1;
  padding: 0.7rem 0;
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
}
.bottom-nav .nav-btn.active {
  background: var(--primary-color);
  color: #fff;
}

/* Cartes (notifications, etc.) */
.card {
  border-radius: 8px;
  }
.card.message-card {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  min-width: 250px;
  max-width: 90%;
  padding: 0.75rem 1rem;
  z-index: 100000;
  display: none;
  animation: fadeSlide 0.5s ease-out;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.message-card.success {
  border-left: 5px solid var(--success-color);
}
.message-card.error {
  border-left: 5px solid var(--danger-color);
}

/* Modals génériques */
.modal-content {
  width: 90%;
  max-width: 300px;
  padding: 1rem;
  text-align: center;
}
.modal-content h4 {
  margin-top: 0;
  color: var(--primary-color);
}
.modal-content .modal-note {
  font-size: 0.8rem;
  color: #555;
}
.modal-content button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#save-prefs-btn,
#stay-connected-btn {
  background: var(--primary-color);
  color: #fff;
}
#close-prefs-btn,
#logout-session-btn {
  background: #ccc;
}

/* Overlay centré, optionnel mais propre */
#prefs-modal.modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.35);
  padding: 16px;
}

/* Empile le contenu en colonne */
#prefs-modal .modal-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px;
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
}

/* Titres et textes */
#prefs-modal h4 { margin: 0 0 4px; color: #FF9500; }

/* Chaque ligne de préférence en ligne avec l’input */
#prefs-modal label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Boutons à droite, espacés */
#prefs-modal .actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px;
}
#save-prefs-btn { background:#FF9500; color:#fff; border:0; padding:10px 14px; border-radius:10px; cursor:pointer; }
#close-prefs-btn { background:#e9e9e9; color:#333; border:0; padding:10px 14px; border-radius:10px; cursor:pointer; }


/* ─── APERÇU COMPACT ─── */

/* Aperçu compact quotidien */
.daily-bonus-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to right, var(--primary-color), var(--primary-color));
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  color: white;
  font-size: 0.9rem;
  width: 300px;
  max-width: 100%;
  margin: 1rem auto;
  transition: opacity 0.3s;
  cursor: pointer;
  text-align: center;
}

.daily-bonus-preview.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.daily-bonus-preview .preview-title {
  font-size: 1rem;
}

#preview-days {
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 0.25rem;
}

/* ─── CONTENU DU MODAL ─── */
/* ───── BONUS MODAL ───── */
@keyframes zoomFade {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.zoom-in {
  animation: zoomFade 0.3s ease-out;
}

#daily-bonus-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  padding: 1rem;
}

.bonus-modal {
  background: var(--bg-color);
  padding: 2rem 1rem;
  border-radius: 16px;
  text-align: center;
  width: 100%;
  margin-left:-20px;/* ← prend toute la largeur dispo dans le parent flex */
  max-width: 300px;         /* ← limite à 300px */
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  animation: zoomFade 0.3s ease-out;
}



.bonus-grid {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  margin: 1rem auto 1.5rem;
  overflow-x: auto;
  padding: 0 1.5rem 0 0.5rem; /* ← plus de marge à droite */
  scroll-snap-type: x mandatory;
  justify-content: flex-start;
  max-width: 90%;
  box-sizing: border-box;
}

.bonus-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.6rem;
  font-weight: bold;
}
.bonus-subtitle {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.bonus-grid::-webkit-scrollbar {
  height: 6px;
}
.bonus-grid::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 6px;
}

.bonus-cell {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 0.5rem;
  flex: 0 0 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  scroll-snap-align: start;
  align-self: stretch;      /* ← occupe toute la hauteur disponible */
  height: 90%;             /* ← hauteur complète dans la ligne */
  box-sizing: border-box;
}

.bonus-cell img {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
}
.day-label {
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--text-color);
}

.bonus-cell.done::after {
  content: '✔';
  position: absolute;
  top: 4px;
  right: 6px;
  background: var(--success-color);
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.75rem;
}
.bonus-cell.highlight {
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
  transform: scale(0.9);
}

/* Bouton Obtenir */
.claim-btn {
  background: var(--primary-color);
  border: none;
  color: white;
  font-size: 1.1rem;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
}
.claim-btn:hover {
  background: var(--primary-color);
}

/* Croix de fermeture */
.close-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  font-size: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

/* Overlay de chargement */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  display: none; /* Caché par défaut */
  pointer-events: all;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cost-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.remember-me {
  display: flex;
  justify-content: center;
  text-align:center;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* POPUP DE VÉRIFICATION AVIS */
#review-check-popup {
  animation: fadeIn 0.3s ease;
}

#review-check-popup .popup-box {
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: scaleIn 0.3s ease;
  text-align: center;
  font-family: "Segoe UI", sans-serif;
}

#review-check-popup h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  color: #333;
}

#review-check-popup p {
  color: #555;
  margin-bottom: 20px;
  font-size: 1rem;
}

#review-check-popup .action-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: var(--primary-color);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 5px;
}

#review-check-popup .action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

#review-check-popup .action-btn:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}

#hidden{display:none;}

/* Texte machine à écrire animé */
#review-typewriter {
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--primary-color);
  display: inline-block;
  font-size: 1rem;
  color: #333;
  margin-top: 15px;
  display: none;
}


@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Superposition floutée */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in-out;
}

/* Boîte centrale */
.popup-box {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.3s ease-out;
  font-family: "Segoe UI", sans-serif;
}

/* Titre */
.popup-box h3 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: var(--primary-color);
}

/* Texte */
.popup-box p {
  margin-bottom: 1.5rem;
  color: #555;
}

/* Bouton d'action */
.popup-box .action-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  font-weight: bold;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.popup-box .action-btn:hover:not(:disabled) {
  background: var(--primary-color);
  transform: scale(1.05);
}

.popup-box .action-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.loading-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: rgba(0,0,0,0.6);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ads-modal {
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ads-box {
  position: relative;
  width: 95vw;
  max-width: 410px;
  aspect-ratio: 9/16;
  background: #fff;
  border-radius: 2.2em;
  box-shadow: 0 8px 32px rgba(0,0,0,0.23);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 2vw;
  padding: 0;
}

.ads-bg-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

.ads-content {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  background: linear-gradient(to top, rgba(46, 29, 0) 60%, rgba(0,0,0,0.04) 100%);
  padding: 2em 1.5em 1.5em 1.5em;
  border-bottom-left-radius: 2.2em;
  border-bottom-right-radius: 2.2em;
}

#ads-title {
  color: #fff;
  font-size: 1.4em;
  margin-bottom: 1.5em;
  font-weight: bold;
  text-shadow: 0 2px 12px rgba(0,0,0,0.34);
}

#ads-cta-btn {
  display: inline-block;
  width: 85%;
  font-size: 1.16rem;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 1em;
  padding: 0.8em 0;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.17);
  cursor: pointer;
  margin-bottom: 0.3em;
  transition: background 0.2s;
}
#ads-cta-btn:hover {
  background: var(--primary-color);
}
.progress-container {
  width: 100%;
  background-color: #eee;
  border-radius: 5px;
  height: 20px;
  overflow: hidden;
  margin: 10px 0;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--primary-color, #0D509F);
  text-align: center;
  line-height: 20px;
  color: white;
  font-size: 12px;
  transition: width 0.2s ease;
}

.scanner-card {
  cursor: pointer;
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.2s ease;
}
.scanner-card:hover {
  transform: scale(1.02);
}
.card-item {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 7 / 2; /* carré responsive */
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  overflow: hidden;
  margin: 10px auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
}

.card-item.card-disabled {
  opacity: 0.6;
  pointer-events: auto;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255,255,255,0.75);
  backdrop-filter: blur(4px);
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  z-index: 3;
}
.loyalty-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.loyalty-card-horizontal {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-color), var(--second-color));
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  color: white;
  padding: 20px;
  width: 100%;
  max-width: 380px;
  min-height: 180px;
  position: relative;
  flex-wrap: wrap;
}

/* Côtés */
.loyalty-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.left {
  flex: 1.5;
}

.right {
  flex: 1;
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.loyalty-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
}

/* Tampons */
.loyalty-stamps {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 10px;
  margin-bottom: 5px;
}

.stamp {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid white;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 6px rgba(255,255,255,0.2);
}

.stamp.filled {
  background-color: white;
}

.stamp-icon {
  width: 16px;
  height: 16px;
  background-size: cover;
  background-position: center;
  filter: invert(1);
}

.stamp.filled .stamp-icon {
  filter: none;
}

.stamp-date {
  font-size: 9px;
  margin-top: 1px;
  color: #333;
}

/* QR Code */
.loyalty-qr-img {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  background: white;
  padding: 4px;
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

.qr-label {
  font-size: 11px;
  margin-top: 6px;
  text-align: center;
  color: #eee;
}

/* Texte récompense */
.loyalty-reward-text {
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
  color: #333;
}

.loyalty-reward-text strong {
  color: var(--primary-color);
  font-weight: bold;
}

/* Bouton */
.loyalty-refresh {
  margin-top: 8px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.loyalty-refresh:hover {
  background-color: var(--primary-hover);
}

/* 🔄 Loader */
.button-loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

/* 🌀 Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes tada {
  0% { transform: scale(1); }
  10%, 20% { transform: scale(0.9) rotate(-3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
  40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1); }
}

/* 🔍 Zoom QR overlay */
#qr-zoom-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: var(--bg-color, white);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#qr-zoom-overlay img {
  max-width: 90vw;
  max-height: 90vh;
}

/* 🔒 Placeholder de connexion */
.loyalty-placeholder {
  padding: 24px;
  background: white;
  border-radius: 12px;
  text-align: center;
  color: #444;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

.loyalty-placeholder:hover {
  background: #f3f3f3;
}

@keyframes stampPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
@keyframes slideUpFade {
  0% {
    transform: translateY(40px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
#loyalty-wrapper {
  display: block;
}

.loyalty-claim-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 18px;
  margin-top: 12px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  animation: tada 0.4s ease;
}
.loyalty-claim-btn:hover {
  background-color: var(--primary-hover);
}



/* ===== POPUP CONFIRM — mobile first, vertical ===== */
#confirm-required.modal{
  position: fixed; inset: 0;
  display: none;
  align-items: flex-end;         /* bottom-sheet sur mobile */
  justify-content: stretch;
  background: color-mix(in srgb, var(--background, #0b0b0b) 35%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200001;
  padding: 0;
}
#confirm-required.open{ display: flex !important; }

/* Carte */
#confirm-required .modal-content{
  width: 100%;
  background: var(--surface, #fff);
  border-radius: 16px 16px 0 0;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;        /* empile tout en vertical */
  gap: 12px;
  box-shadow: 0 -2px 18px rgba(0,0,0,.18);
  animation: cr-slide-up .22s cubic-bezier(.2,.7,.2,1);
  position: relative;
}

/* poignée style bottom-sheet */
#confirm-required .modal-content::before{
  content:"";
  position:absolute; top:8px; left:50%; transform:translateX(-50%);
  width: 38px; height: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary-color, #905de8) 14%, #999);
  opacity:.8;
}

/* Titre et texte */
#confirm-required h4{
  margin: 14px 0 2px; padding-top: 10px;  /* espace à cause de la poignée */
  font-size: 1.05rem; font-weight: 800; text-align: center;
  color: var(--primary-color, #905de8);
}
#confirm-required p{
  margin: 0; text-align: center;
  font-size: 0.98rem; line-height: 1.5;
  color: var(--text-muted, #5b5b5b);
}

/* Boutons — 100% largeur, touch targets confortables */
#resend-confirm-btn,
#close-confirm-required{
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  padding: 12px 14px;
  transition: transform .08s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

/* Primaire */
#resend-confirm-btn{
  background: var(--primary-color, #905de8);
  color: var(--on-primary, #fff);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color, #905de8) 28%, transparent);
}
#resend-confirm-btn:hover{ transform: translateY(-1px); }
#resend-confirm-btn:active{ transform: translateY(0); }

/* Secondaire */
#close-confirm-required{
  background: color-mix(in srgb, var(--primary-color, #905de8) 6%, transparent);
  color: var(--primary-color, #905de8);
  border: 1px solid color-mix(in srgb, var(--primary-color, #905de8) 26%, transparent);
}

/* Focus accessible */
#resend-confirm-btn:focus-visible,
#close-confirm-required:focus-visible{
  outline: 3px solid color-mix(in srgb, var(--primary-color, #905de8) 55%, #fff);
  outline-offset: 2px;
}

/* Desktop: fenêtre centrée et plus compacte */
@media (min-width: 480px){
  #confirm-required.modal{ align-items: center; justify-content: center; padding: 16px; }
  #confirm-required .modal-content{
    width: min(420px, 92vw);
    border-radius: 16px;
  }
}

/* Réduction d’animation si demandée par l’utilisateur */
@media (prefers-reduced-motion: reduce){
  #confirm-required .modal-content{ animation: none; }
}

/* Animation d’apparition */
@keyframes cr-slide-up{
  from{ transform: translateY(14px); opacity: 0; }
  to  { transform: translateY(0);    opacity: 1; }
}

/* Etat de chargement pendant l’envoi du lien */
#resend-confirm-btn.loading {
  position: relative;
  pointer-events: none;
  opacity: .9;
}

#resend-confirm-btn.loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateY(-50%);
  border: 2px solid color-mix(in srgb, var(--on-primary, #fff) 30%, transparent);
  border-top-color: var(--on-primary, #fff);
  animation: confirm-spin .7s linear infinite;
}

#close-confirm-required:disabled {
  opacity: .7;
  pointer-events: none;
}

@keyframes confirm-spin { to { transform: translateY(-50%) rotate(360deg); } }
