/* Reset y estilos base optimizados */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    line-height: 1.6;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Optimizaciones de rendimiento */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Optimizaciones para móviles */
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mejoras específicas para móviles */
@media (max-width: 768px) {
    body {
        background: #ffffff;
        padding: 0;
        margin: 0;
        font-size: 16px;
        width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        max-width: 100vw;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        max-width: 100vw;
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }
}

/* Nueva cabecera con fondo turquesa */
.header {
    background: linear-gradient(135deg, #00AC99 0%, #00C4A7 50%, #00D4B5 100%);
    color: white;
    padding: 0;
    margin: 0;
    position: relative;
    border-radius: 0;
    height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0; /* Evita que el header se contraiga */
    min-height: 200px; /* Altura mínima garantizada */
}

/* Optimizaciones para móviles */
@media (max-width: 768px) {
    .header {
        height: 40vh;
        padding: 0;
        flex-shrink: 0;
        min-height: 180px;
    }
}

@media (max-width: 480px) {
    .header {
        height: 35vh;
        min-height: 200px;
        flex-shrink: 0;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 360px) {
    .header {
        height: 30vh;
        min-height: 180px;
        flex-shrink: 0;
    }
}

/* Orientación horizontal */
@media (orientation: landscape) and (max-height: 600px) {
    .header {
        height: 50vh;
        min-height: 150px;
        flex-shrink: 0;
    }
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 0;
    margin: 0;
}

.star-emoji {
    font-size: 4rem;
    margin: 0;
    animation: float 3s ease-in-out infinite;
}

.header-image {
    max-height: 60%;
    max-width: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Responsive para emoji */
@media (max-width: 768px) {
    .star-emoji {
        font-size: 3.5rem;
    }
    
    .header-image {
        max-height: 55%;
        max-width: 75%;
    }
}

@media (max-width: 480px) {
    .star-emoji {
        font-size: 3rem;
    }
    
    .header-image {
        max-height: 50%;
        max-width: 70%;
    }
}

@media (max-width: 360px) {
    .star-emoji {
        font-size: 2.5rem;
    }
    
    .header-image {
        max-height: 45%;
        max-width: 65%;
    }
}

/* Orientación horizontal */
@media (orientation: landscape) and (max-height: 600px) {
    .star-emoji {
        font-size: 2.5rem;
    }
    
    .header-image {
        max-height: 70%;
        max-width: 60%;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Decoración de onda */
.wave-decoration {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.wave-decoration::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.3) 100%);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

@media (max-width: 768px) {
    .header {
        height: 35vh;
        padding: 15px;
    }
    
    .star-emoji {
        font-size: 3rem;
    }
    
    .header-image {
        max-height: 55%;
        max-width: 75%;
    }
}

/* Botón de tema reposicionado */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Responsive para botón de tema */
@media (max-width: 768px) {
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Touch devices */
@media (hover: none) {
    .theme-toggle:hover {
        transform: none;
    }
    
    .theme-toggle:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.4);
    }
}

/* Área de contenido */
.content {
    flex: 1;
    padding: 30px 20px 0 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Previene overflow */
}

/* Corrección para el área de contenido */
@media (max-width: 768px) {
    .content {
        padding: 20px 15px 0 15px;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 15px 12px 0 12px;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 360px) {
    .content {
        padding: 12px 10px 0 10px;
        width: 100%;
    }
}

.content-title {
    font-family: 'Kanit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 20px;
    text-align: center;
}

/* Responsive para título */
@media (max-width: 768px) {
    .content-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .content-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 360px) {
    .content-title {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px 15px 0 15px;
    }
    
    .content-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
}

/* Logo móvil en la parte superior (cuando hay colaborador seleccionado) */
.top-logo {
    background: #ffffff;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* Responsive para logo superior */
@media (max-width: 768px) {
    .top-logo {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .top-logo {
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .top-logo {
        padding: 10px;
    }
}

/* Footer con logo */
.footer {
    background: #ffffff;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-top: auto;
}

/* Responsive para footer */
@media (max-width: 768px) {
    .footer {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .footer {
        padding: 10px;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Responsive para logo */
@media (max-width: 480px) {
    .logo-container {
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .logo-container {
        gap: 6px;
    }
}

.logo-icon {
    font-size: 1.5rem;
    color: #00AC99;
}

.logo-image {
    height: 55px;
    width: auto;
    object-fit: contain;
    filter: brightness(0.8);
}

/* Responsive para logo imagen */
@media (max-width: 480px) {
    .logo-image {
        height: 45px;
    }
}

@media (max-width: 360px) {
    .logo-image {
        height: 40px;
    }
}

.logo-text {
    text-align: left;
}

.logo-title {
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-family: 'Kanit', sans-serif;
    font-size: 0.7rem;
    color: #6B7280;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* Responsive para texto del logo */
@media (max-width: 480px) {
    .logo-title {
        font-size: 0.8rem;
    }
    
    .logo-subtitle {
        font-size: 0.65rem;
    }
}

@media (max-width: 360px) {
    .logo-title {
        font-size: 0.75rem;
    }
    
    .logo-subtitle {
        font-size: 0.6rem;
    }
}

/* Estilos del buscador - Mobile First */
.search-section {
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Previene overflow */
}

.search-input-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Previene overflow */
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    color: #495057;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    max-width: 100%;
    min-width: 0; /* Previene overflow */
}

/* Corrección responsive para móviles */
@media (max-width: 768px) {
    .search-section {
        width: 100%;
        box-sizing: border-box;
    }
    
    .search-input-container {
        width: 100%;
        box-sizing: border-box;
    }
    
    .search-input {
        width: 100%;
        padding: 14px 18px;
        border-radius: 20px;
        font-size: 16px;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding: 12px 16px;
        border-radius: 18px;
        font-size: 16px;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .search-input {
        padding: 14px 18px;
        border-radius: 20px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
    }
}

.search-input:focus {
    outline: none;
    border-color: #00AC99;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 172, 153, 0.1);
}

@media (max-width: 768px) {
    .search-input:focus {
        border-color: #00AC99;
        box-shadow: 0 0 0 2px rgba(0, 172, 153, 0.1);
    }
}

.search-input::placeholder {
    color: #9CA3AF;
    font-size: 0.95rem;
    text-align: center;
}

.search-hint {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    font-size: 0.75em;
    color: #666;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 8px 8px;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid #e0e0e0;
    border-top: none;
}

.search-input-container.active .search-hint {
    display: block;
}

.search-results {
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    display: none;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .search-results {
        border-radius: 8px;
        max-height: 250px;
        border: 1px solid #dee2e6;
    }
}

/* Estilos para resaltar coincidencias - Mobile optimized */
.search-result-item mark {
    background-color: #00AC99;
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .search-result-item mark {
        background-color: #00C4A7;
        padding: 1px 3px;
        border-radius: 3px;
    }
}

.search-result-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: white;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Kanit', sans-serif;
}

@media (max-width: 768px) {
    .search-result-item {
        padding: 14px;
        border-bottom: 1px solid #e9ecef;
    }
}

.search-result-item:hover,
.search-result-item:active {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .search-result-item:hover,
    .search-result-item:active {
        background-color: #f1f3f4;
        transform: none;
    }
}

.search-result-item:hover mark,
.search-result-item:active mark {
    background-color: #1e7e34;
}

@media (max-width: 768px) {
    .search-result-item:hover mark,
    .search-result-item:active mark {
        background-color: #17a2b8;
    }
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .result-name {
        font-size: 0.9em;
        margin-bottom: 3px;
    }
}

/* Ocultar legajo en resultados de búsqueda para ahorrar espacio */
.result-legajo {
    display: none !important;
}

.result-legajo {
    color: #666;
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .result-legajo {
        font-size: 0.8em;
        color: #6c757d;
    }
}

/* Estilos del colaborador seleccionado - Mobile */
.selected-section {
    margin-bottom: 25px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: none;
    border: none;
    box-shadow: none;
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .selected-section {
        margin-bottom: 20px;
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: auto;
    }
}

/* Tarjeta compacta del colaborador */
.selected-card {
    background: #5a6b7a;
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 20px 20px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 80px;
}

@media (max-width: 768px) {
    .selected-card {
        padding: 16px 20px;
        gap: 12px;
        border-radius: 10px;
        margin: 0 15px 15px 15px;
        min-height: 70px;
    }
}

.selected-emoji {
    font-size: 2rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .selected-emoji {
        font-size: 1.8rem;
    }
}

.selected-details {
    flex: 1;
    min-width: 0;
}

.selected-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    font-family: 'Kanit', sans-serif;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .selected-name {
        font-size: 1rem;
        margin-bottom: 1px;
    }
}

.selected-legajo {
    color: #b8c5d1;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Kanit', sans-serif;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .selected-legajo {
        font-size: 0.85rem;
    }
}

.selected-section[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fuerza la visualización cuando está activa */
.selected-section.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Específico para GitHub Pages */
.selected-section[data-visible="true"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    min-height: 300px !important;
}

@media (max-width: 768px) {
    .selected-section[data-visible="true"] {
        min-height: 250px !important;
    }
}

/* Fallback para cualquier elemento con selectedSection */
#selectedSection {
    transition: all 0.3s ease;
}

#selectedSection.active,
#selectedSection[data-visible="true"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Formulario responsive */
.form-group {
    margin-bottom: 20px;
    padding: 0 20px;
}

/* Remover padding del form-group que contiene el checkbox */
.form-group:has(.checkbox-container-modern) {
    padding: 0;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 15px;
        padding: 0 15px;
    }
    
    .form-group:has(.checkbox-container-modern) {
        padding: 0;
        margin-bottom: 0;
    }
}

.form-actions {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 10px;
    flex-direction: column;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

@media (max-width: 768px) {
    .form-actions {
        padding: 15px;
        border-radius: 0 0 8px 8px;
        background: #ffffff;
        border-top: 1px solid #dee2e6;
    }
}

.btn-primary {
    background: #00AC99;
    color: white;
    border: none;
    order: 1;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 172, 153, 0.3);
}

@media (max-width: 768px) {
    .btn-primary {
        background: #00AC99;
        border-radius: 25px;
        font-size: 16px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

.btn-primary:hover {
    background: #00C4A7;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 172, 153, 0.4);
}

@media (max-width: 768px) {
    .btn-primary:hover {
        background: #00C4A7;
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 172, 153, 0.3);
    }
}

.btn-secondary {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    border: none;
    order: 2;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.4);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    box-shadow: 0 6px 16px rgba(52, 73, 94, 0.6);
    transform: translateY(-2px);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

@media (max-width: 768px) {
    .btn-secondary:hover {
        background: #5a6268;
        transform: none;
        box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    }
}

#registrationForm {
    padding-top: 20px;
}

@media (max-width: 768px) {
    #registrationForm {
        padding-top: 15px;
    }
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    font-family: 'Kanit', sans-serif;
}

@media (max-width: 768px) {
    .form-label {
        font-size: 0.85em;
        margin-bottom: 6px;
        color: #495057;
    }
}

.form-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
}

@media (max-width: 768px) {
    .form-input {
        padding: 12px;
        border-radius: 8px;
        border: 1px solid #ced4da;
        font-size: 16px;
    }
}

.form-input:focus {
    outline: none;
    border-color: #00AC99;
    background: white;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

@media (max-width: 768px) {
    .form-input:focus {
        border-color: #00C4A7;
        box-shadow: 0 0 0 2px rgba(32, 201, 151, 0.1);
    }
}

.form-input[type="number"] {
    text-align: center;
    font-weight: 600;
}

/* Helper text para formularios */
.form-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 4px;
    margin-left: 2px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .form-help {
        font-size: 0.8rem;
    }
}

/* Checkbox moderno más grande */
.checkbox-container-modern {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 20px 20px 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.checkbox-container-modern:hover {
    background: #e9ecef;
}

.checkbox-modern {
    width: 32px;
    height: 32px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex-shrink: 0;
    min-width: 32px;
    min-height: 32px;
}

.checkbox-modern:checked {
    background: #007bff;
    border-color: #007bff;
}

.checkbox-modern:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.checkbox-label-modern {
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #495057;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

/* Responsive para checkbox moderno */
@media (max-width: 768px) {
    .checkbox-container-modern {
        padding: 18px;
        margin: 0 15px 15px 15px;
        gap: 13px;
        border-radius: 10px;
    }
    
    .checkbox-modern {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
    }
    
    .checkbox-modern:checked::after {
        font-size: 18px;
    }
    
    .checkbox-label-modern {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .checkbox-container-modern {
        padding: 16px;
        gap: 12px;
        margin: 0 12px 12px 12px;
    }
    
    .checkbox-modern {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }
    
    .checkbox-modern:checked::after {
        font-size: 16px;
    }
    
    .checkbox-label-modern {
        font-size: 14px;
    }
}

/* Estilos base para botones */
.btn {
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 54px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    margin-bottom: 10px;
}

/* Responsive para botones */
@media (max-width: 768px) {
    .btn {
        padding: 14px 28px;
        border-radius: 25px;
        font-size: 16px;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 12px 24px;
        font-size: 15px;
        min-height: 48px;
    }
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .btn:hover {
        transform: none;
    }
}

/* ===== ESTILOS PARA TARJETAS DE CARGA Y CONFIRMACIÓN ===== */

/* Tarjeta de carga de envío */
.submission-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in-out;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #00AC99;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-content h2 {
    font-family: 'Kanit', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
}

.loading-content p {
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

/* Mejoras adicionales para el modal de carga */
.loading-content h2 {
    transition: all 0.3s ease;
}

.loading-content p {
    transition: all 0.3s ease;
    opacity: 0.8;
}

/* Animación de pulso para el spinner */
.loading-spinner {
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid rgba(0, 172, 153, 0.2);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Estados del modal */
.loading-content.verifying h2 {
    color: #059669;
}

.loading-content.processing h2 {
    color: #0891b2;
}

.loading-content.error h2 {
    color: #dc2626;
}

/* Tarjeta de confirmación de éxito */
.success-confirmation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in-out;
}

/* Pantalla final de éxito - ocupa toda la pantalla */
.success-final-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: fadeIn 0.3s ease-in-out;
}

.success-content {
    background: white;
    padding: 40px 35px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 85%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease-out;
    position: relative;
}

.success-icon {
    margin-bottom: 25px;
}

.checkmark-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #10b981;
    border-radius: 50%;
    animation: bounceIn 0.6s ease-out;
}

.checkmark {
    color: white;
    font-size: 40px;
    font-weight: bold;
    line-height: 1;
}

.success-content h2 {
    font-family: 'Kanit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 20px;
    margin-top: 0;
}

.success-details {
    margin-bottom: 30px;
}

.success-details p {
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem;
    color: #374151;
    margin: 8px 0;
}

.success-details p strong {
    color: #059669;
    font-weight: 600;
}

.success-time {
    font-size: 0.9rem !important;
    color: #9CA3AF !important;
    margin-top: 15px !important;
    font-style: italic;
}

.success-actions {
    margin-top: 30px;
}

.success-actions {
    margin-top: 30px;
}

.btn-success-primary {
    background: #10b981 !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 15px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: 'Kanit', sans-serif !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    min-width: 150px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.btn-success-primary:hover {
    background: #059669 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3) !important;
}

.success-actions .btn {
    min-width: 150px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* Tarjeta de confirmación de error */
.error-confirmation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in-out;
}

.error-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease-out;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

.error-content h2 {
    font-family: 'Kanit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #DC2626;
    margin-bottom: 25px;
}

.error-details {
    margin-bottom: 30px;
}

.error-details p {
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem;
    color: #374151;
    margin: 8px 0;
}

.error-time {
    font-size: 0.9rem !important;
    color: #9CA3AF !important;
    margin-top: 15px !important;
    font-style: italic;
}

.error-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== ESTILOS PARA SISTEMA DE DNI ===== */

/* Sección de DNI */
.dni-section {
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.dni-input-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.dni-label {
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    margin-bottom: 10px;
}

.dni-input {
    width: 100%;
    max-width: 300px;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #495057;
    font-family: 'Kanit', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
    letter-spacing: 1px;
}

.dni-input:focus {
    outline: none;
    border-color: #00AC99;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 172, 153, 0.1);
}

.dni-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
    letter-spacing: normal;
}

/* Helper text específico para DNI */
.dni-input-container .form-help {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    margin-top: -10px;
    margin-bottom: 5px;
    line-height: 1.4;
    max-width: 300px;
}

@media (max-width: 768px) {
    .dni-input-container .form-help {
        font-size: 0.8rem;
        margin-top: -8px;
    }
}

.dni-message {
    padding: 12px 20px;
    border-radius: 10px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    margin-top: 10px;
    display: none;
}

.dni-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.dni-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.dni-message.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.dni-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Sección de registro */
.registration-section {
    margin-bottom: 25px;
    display: none;
    width: 100%;
    box-sizing: border-box;
}

/* Formulario de datos personales */
.personal-data-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin: 0 20px 20px 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    margin-bottom: 20px;
}

.personal-data-form .form-group {
    margin-bottom: 20px;
    padding: 0;
}

.personal-data-form .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    font-family: 'Kanit', sans-serif;
}

.personal-data-form .form-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
}

.personal-data-form .form-input:focus {
    outline: none;
    border-color: #00AC99;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 172, 153, 0.1);
}

/* Estilos específicos para input de fecha */
.personal-data-form .form-input[type="date"] {
    position: relative;
    background: #ffffff;
    cursor: pointer;
}

.personal-data-form .form-input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

.personal-data-form .form-input[type="date"]:focus::-webkit-calendar-picker-indicator {
    background: rgba(0, 172, 153, 0.1);
    border-radius: 4px;
}

/* Responsive para campos de fecha */
@media (max-width: 768px) {
    .personal-data-form .form-input[type="date"] {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Participante existente */
.existing-participant {
    margin: 0 20px 20px 20px;
}

.participant-card {
    background: linear-gradient(135deg, #4285f4, #1976d2);
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
    min-height: 80px;
    color: white;
}

.participant-emoji {
    font-size: 2rem;
    flex-shrink: 0;
}

.participant-details {
    flex: 1;
    min-width: 0;
}

.participant-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    font-family: 'Kanit', sans-serif;
    line-height: 1.2;
}

.participant-dni {
    color: #b8f5f0;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Kanit', sans-serif;
    line-height: 1.2;
}

/* Responsive para DNI */
@media (max-width: 768px) {
    .dni-input-container {
        gap: 12px;
    }
    
    .dni-label {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .dni-input {
        max-width: 280px;
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 20px;
    }
    
    .dni-message {
        padding: 10px 16px;
        font-size: 0.9rem;
        margin-top: 8px;
    }
    
    .personal-data-form {
        padding: 20px;
        margin: 0 15px 15px 15px;
        border-radius: 10px;
    }
    
    .form-title {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }
    
    .personal-data-form .form-input {
        padding: 12px;
        border-radius: 8px;
        font-size: 16px;
    }
    
    .existing-participant {
        margin: 0 15px 15px 15px;
    }
    
    .participant-card {
        padding: 16px 20px;
        gap: 12px;
        border-radius: 10px;
        min-height: 70px;
    }
    
    .participant-emoji {
        font-size: 1.8rem;
    }
    
    .participant-name {
        font-size: 1rem;
    }
    
    .participant-dni {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .dni-input {
        max-width: 250px;
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 18px;
    }
    
    .personal-data-form {
        padding: 16px;
        margin: 0 12px 12px 12px;
    }
    
    .form-title {
        font-size: 1.1rem;
    }
    
    .participant-card {
        padding: 14px 18px;
    }
}

/* Botón de verificar DNI */
#checkDniBtn {
    background: #00AC99;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 172, 153, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 50px;
}

#checkDniBtn:hover {
    background: #00C4A7;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 172, 153, 0.4);
}

#checkDniBtn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    #checkDniBtn {
        padding: 12px 24px;
        font-size: 15px;
        min-height: 46px;
        border-radius: 20px;
    }
    
    #checkDniBtn:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 172, 153, 0.3);
    }
}

@media (max-width: 480px) {
    #checkDniBtn {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 42px;
    }
}

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1);
        opacity: 0.2;
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .loading-content,
    .success-content,
    .error-content {
        padding: 30px 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .loading-content h2,
    .success-content h2,
    .error-content h2 {
        font-size: 1.6rem;
    }
    
    .loading-content p,
    .success-details p,
    .error-details p {
        font-size: 1rem;
    }
    
    .success-icon,
    .error-icon {
        font-size: 3rem;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        border-width: 5px;
    }
    
    .error-actions {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .loading-content,
    .success-content,
    .error-content {
        padding: 25px 15px;
        margin: 15px;
        width: calc(100% - 30px);
    }
    
    .loading-content h2,
    .success-content h2,
    .error-content h2 {
        font-size: 1.4rem;
    }
    
    .success-icon,
    .error-icon {
        font-size: 2.5rem;
    }
}

/* ===== ESTILOS PARA SISTEMA DE PANTALLAS MÚLTIPLES ===== */

/* Contenedor de pantallas */
.screen {
    width: 100%;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.screen.hidden {
    display: none !important;
}

/* Ocultar header en pantallas que no sean la inicial */
.content-wrapper:has(#registrationScreen:not([style*="display: none"])) .header,
.content-wrapper:has(#alreadyRegisteredScreen:not([style*="display: none"])) .header {
    display: none;
}

/* Si el navegador no soporta :has(), usar clases auxiliares */
body.hide-header .header {
    display: none !important;
}

body.hide-header .content-wrapper {
    padding-top: 20px;
    margin-top: 0;
}

body.hide-header .content {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Transición suave para ocultar/mostrar header */
.header {
    transition: all 0.3s ease-in-out;
}

body.hide-header .header {
    opacity: 0;
    transform: translateY(-100%);
}

/* Pantalla 1: Verificación DNI */
.dni-section {
    text-align: center;
    padding: 30px 20px;
}

.content-subtitle {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.dni-input-container {
    max-width: 400px;
    margin: 0 auto;
}

/* Pantalla 2: Formulario de registro */
.registration-header {
    text-align: center;
    padding: 25px 20px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-top: 20px;
}

/* Ajustes cuando no hay header */
body.hide-header .registration-header {
    margin-top: 0;
}

body.hide-header .dni-section {
    padding-top: 40px;
}

body.hide-header .already-registered {
    padding-top: 40px;
}

.registration-header .content-title {
    color: white;
    margin-bottom: 10px;
}

.registration-header .content-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.dni-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    font-size: 1.1rem;
}

/* Pantalla 3: Ya registrado */
.already-registered {
    text-align: center;
    padding: 30px 20px;
}

.already-registered .participant-card {
    margin-bottom: 30px;
}

.already-registered h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Navegación entre pantallas */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* Animaciones de transición */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.screen.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

.screen.slide-in-left {
    animation: slideInLeft 0.4s ease-out;
}

@media (max-width: 768px) {
    .dni-section {
        padding: 20px 15px;
    }
    
    .registration-header {
        margin: 0 -10px 20px -10px;
        border-radius: 10px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .dni-input-container {
        padding: 0 10px;
    }
    
    .registration-header {
        padding: 15px;
        margin: 0 -5px 15px -5px;
    }
    
    .registration-header .content-title {
        font-size: 1.3rem;
    }
    
    .dni-display {
        font-size: 1rem;
        padding: 8px 15px;
    }
}