body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: #4a006e; /* Morado oscuro */
    margin: 0;
    color: #f0f0f0; /* Cambiar color de texto para contraste */
}

.card {
    background: white; /* Vuelve a blanco */
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-sizing: border-box;
    color: #333; /* Asegurar que el texto dentro de la tarjeta sea oscuro */
    border: 2px solid transparent; /* Borde transparente por defecto */
    transition: border-color 0.5s, box-shadow 0.5s;
}

.client-logo {
    max-width: 150px; /* Ajusta esto según el tamaño deseado */
    height: auto;
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: logo-load-in 0.8s ease-out forwards;
}

@keyframes logo-load-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    80% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

h1 {
    margin-top: 0;
    color: #2c3e50;
}

.stamps-container {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    justify-content: center;
    gap: 10px;
    margin: 2.5rem auto; /* Centra el contenedor */
}

.stamp {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px; /* Ajustar tamaño de fuente */
    color: white;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    position: relative;
}

.stamp.filled {
    background: #27ae60 !important; /* Verde con !important para forzar el estilo */
    transform: scale(1.1);
}

.stamp.filled::before {
    content: '✔';
}

@keyframes stamp-fill-animation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.1); /* Vuelve al tamaño de .filled */
    }
}

.stamp.newly-filled {
    animation: stamp-fill-animation 0.3s ease-out forwards;
}

/* --- ESTILOS PARA SELLO DE REGALO --- */
.stamp.gift-stamp {
    background: #e0e0e0; /* Gris por defecto */
    border: 2px dashed #c0c0c0;
    opacity: 0.7;
}

.stamp.gift-stamp::before {
    content: '🎁';
    opacity: 1; /* Hacer el ícono siempre visible */
    font-size: 32px; /* Ajustar tamaño del ícono */
}

.stamp.gift-stamp.ready {
    background: #b8860b; /* Dorado, igual que el botón */
    border-style: solid;
    border-color: #daa520;
    opacity: 1;
    transform: scale(1.1);
    animation: gift-pulse 1.5s infinite ease-in-out; /* Animación de pulso */
}

@keyframes gift-pulse {
    0% {
        transform: scale(1.1);
        box-shadow: 0 0 5px rgba(218, 165, 32, 0.7);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 15px rgba(218, 165, 32, 1);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 0 5px rgba(218, 165, 32, 0.7);
    }
}


.stamp.gift-stamp.ready::before {
    opacity: 1;
}


#scan-btn {
    background: #b8860b; /* Dorado elegante (DarkGoldenRod) */
    color: black; /* Texto negro */
    font-weight: bold; /* Negrita */
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

#scan-btn:hover {
    background: #daa520; /* Dorado más claro al pasar el ratón (GoldenRod) */
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#scan-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.secondary-button {
    background: #6c757d; /* Un gris neutro */
    color: white;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.secondary-button:hover {
    background: #5a6268; /* Gris más oscuro al pasar el ratón */
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.secondary-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#qr-reader {
    border: 1px solid #eee;
    border-radius: 8px;
    min-height: 250px; /* Reservar espacio para evitar saltos en la animación */
    background: #f0f0f0; /* Color de fondo mientras carga la cámara */
}

#install-btn {
    background: #4CAF50; /* Un verde distintivo */
    color: white; /* Texto blanco */
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

#install-btn:hover {
    background: #43A047; /* Verde más oscuro al pasar el ratón */
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#install-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#status-text {
    font-weight: bold;
    font-size: 1.1rem;
    color: #34495e;
    min-height: 40px; /* Para evitar que el layout salte al cambiar el texto */
}

/* --- ESTILOS PARA CANJEAR --- */

@keyframes glow {
  0% { box-shadow: 0 0 3px #daa520; }
  50% { box-shadow: 0 0 20px #daa520, 0 0 10px #daa520; }
  100% { box-shadow: 0 0 3px #daa520; }
}

@keyframes celebrate-bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-5px); }
}

.card.celebrate {
    animation: celebrate-bounce 0.6s ease-out;
}

.card.freebie-ready {
    animation: glow 2.5s infinite;
    border-color: #daa520; /* Borde dorado */
}

.card.freebie-ready #status-text {
    font-size: 1.3rem; /* Texto más grande */
    color: #b8860b; /* Color dorado para el texto */
    transform: scale(1.05);
    transition: all 0.5s;
}

/* --- ESTILOS PARA MODAL --- */
@keyframes modal-animation {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#modal-container {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#modal-container.is-visible {
    display: flex;
}

#modal-container.is-visible #modal-content {
    animation: modal-animation 0.2s ease-out forwards;
}

#modal-content {
    background: white;
    padding: 20px 30px; /* Más margen a los lados */
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    position: relative;
    text-align: center;
}

#modal-content h3 {
    color: black; /* Asegurar que el título del modal sea legible */
}

#modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
}

#modal-close-btn:hover {
    color: #000;
}

#loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    opacity: 1; /* Asegurar que esté visible por defecto para la transición */
    transition: opacity 0.3s ease-out;
}

#loading-spinner.hidden {
    opacity: 0;
    pointer-events: none; /* Para que no interfiera con clics */
}

#loading-spinner img {
    width: 67%; /* Reducir el tamaño del GIF en un 33% */
    height: auto;
}

#qr-reader {
    border: 1px solid #eee;
    border-radius: 8px;
    min-height: 250px; /* Reservar espacio para evitar saltos en la animación */
    background: #f0f0f0; /* Color de fondo mientras carga la cámara */
}