:root {
    --color-primario: #1a237e;
    --color-secundario: #d81b60;
    --color-fondo: #f0f2f5;
    --color-superficie: #ffffff;
    --color-texto: #333;
    --color-texto-suave: #777;
    --color-exito: #2e7d32;
    --color-error: #c62828;
    --color-advertencia: #ff8f00;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1em;
}

.main-container {
    background: var(--color-superficie);
    padding: 2em;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 500px;
    transition: all 0.3s ease;
}

header {
    margin-bottom: 1.5em;
}

.logo {
    max-width: 130px;
    margin-bottom: 1em;
}

h1 {
    color: var(--color-primario);
    margin: 0;
    font-weight: 700;
}

#form-container {
    margin-top: 2em;
}

#form-container h2 {
    color: var(--color-texto);
    margin-bottom: 1.5em;
    font-size: 1.3em;
    font-weight: 600;
}

label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    text-align: left;
    color: var(--color-texto-suave);
}

select, input[type="text"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 1.5em;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

.wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1em;
}

.wheel-container::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid var(--color-error);
    z-index: 10;
}

#boton-girar {
    margin-top: -30px; /* Sube el botón */
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, var(--color-secundario), #8e24aa);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

#boton-girar:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#boton-girar:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* --- ESTILOS DE VALIDACIÓN --- */
.input-group {
    display: flex;
    gap: 10px;
}
#input-id-cliente {
    flex-grow: 1;
    margin-bottom: 0;
}
#boton-validar {
    padding: 12px 20px;
    border: none;
    background-color: var(--color-primario);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s;
}
#boton-validar:hover {
    background-color: #283593;
}
#estado-validacion {
    margin-top: 8px;
    font-size: 0.9em;
    font-weight: bold;
    min-height: 1.2em;
}

/* --- ESTILOS DEL MODAL --- */
.modal-oculto { display: none; }
#modal-resultados {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}
.contenido-modal {
    background-color: var(--color-superficie);
    padding: 2em 2.5em;
    border-radius: 16px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
.boton-cerrar {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
}
#texto-premio {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--color-secundario);
    margin: 0.5em 0;
}
#estado-datos {
    font-style: italic;
    color: var(--color-texto-suave);
    margin-top: 1em;
}
#contenedor-boton-modal button {
    margin-top: 1em;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    background-color: var(--color-exito);
    border: none;
    border-radius: 50px;
    cursor: pointer;
}

/* --- ESTILOS DE CARGA Y ESTADOS OCULTOS --- */
.hidden { display: none !important; }

#pantalla-carga {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--color-fondo);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--color-primario);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
.texto-carga {
    margin-top: 20px;
    font-size: 1.2em;
    color: var(--color-primario);
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilo para el enlace a la guía de capacitación */
.enlace-capacitacion {
    margin-top: 2em;
    font-size: 0.9em;
    color: var(--color-texto-suave);
}
.enlace-capacitacion a {
    color: var(--color-primario);
    font-weight: 600;
    text-decoration: none;
}
.enlace-capacitacion a:hover {
    text-decoration: underline;
}