/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px; /* Reducido de 1000px */
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* Encabezado */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    max-width: 200px;
    height: auto;
}

.welcome-message {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: left;
    line-height: 1.6;
}

.welcome-message p {
    margin-bottom: 12px;
    color: #555;
}

.welcome-message p:last-child {
    margin-bottom: 0;
}

.candidate-name, .candidate-position {
    font-weight: 700;
    color: #424242;
}

h1 {
    color: #424242;
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    color: #757575;
    font-size: 16px;
}

/* Formulario */
form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-section {
    grid-column: span 2;
    background-color: #fafafa;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #757575;
    margin-bottom: 10px;
}

.form-section h2 {
    color: #424242;
    margin-bottom: 15px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #616161;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fcfcfc;
    color: #424242;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: #757575;
    box-shadow: 0 0 0 2px rgba(117, 117, 117, 0.2);
    outline: none;
}

/* Estilo para campos inválidos */
.invalid {
    border-color: #e53935;
    background-color: #ffebee;
}

.invalid:focus {
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.2);
}

.form-group.col-2 {
    grid-column: span 1;
}

.small-text {
    font-size: 0.85em;
    font-weight: normal;
    color: #757575;
}

/* Opciones de colaboración - ESPACIADO REDUCIDO AÚN MÁS */
.collaboration-options {
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    padding: 6px; /* Reducido al mínimo */
    border-radius: 10px;
    margin-top: 8px;
    border: 1px solid #e0e0e0;
}

.collaboration-title {
    font-weight: 600;
    color: #424242;
    margin-bottom: 4px; /* Mínimo espacio */
}

/* Botones de toggle sin espacio entre ellos */
.toggle-option {
    margin-bottom: 0 !important; /* Sin espacio entre opciones */
    position: relative;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    padding: 2px 0; /* Mínimo padding vertical */
    transition: all 0.3s ease;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px; /* Ligeramente reducido */
    height: 20px; /* Ligeramente reducido */
    background-color: #e0e0e0;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-right: 8px; /* Reducido */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-switch:before {
    content: '';
    position: absolute;
    width: 16px; /* Reducido */
    height: 16px; /* Reducido */
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch {
    background-color: #757575;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch:before {
    transform: translateX(22px); /* Ajustado para el nuevo tamaño */
}

.toggle-option:hover .toggle-switch {
    background-color: #cccccc;
}

.toggle-checkbox:checked + .toggle-label:hover .toggle-switch {
    background-color: #616161;
}

/* Botones */
.btn-container {
    grid-column: span 2;
    text-align: center;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    background-color: #757575;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #616161;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #424242;
    margin-right: 10px;
}

.btn-secondary:hover {
    background-color: #d5d5d5;
}

/* Campos requeridos y notas */
.required::after {
    content: "*";
    color: #757575;
    margin-left: 5px;
}

.note {
    font-size: 14px;
    color: #757575;
    margin-top: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalopen 0.4s;
}

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

.modal-header {
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    color: #424242;
    font-size: 22px;
    text-align: center;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #757575;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #424242;
}

.modal-body {
    padding: 30px 20px;
    text-align: center;
}

.modal-body p {
    margin-bottom: 15px;
    color: #616161;
    font-size: 16px;
}

.success-icon {
    display: inline-block;
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    background-color: #4caf50;
    color: white;
    font-size: 35px;
    margin-bottom: 20px;
}

.candidate-signature {
    margin-top: 30px;
    font-style: italic;
    color: #757575;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

/* Contenedor para el spinner y texto de carga */
.loading-content {
    position: relative;
    background-color: rgba(255, 255, 255, 0.9);
    margin: 30% auto;
    padding: 25px;
    width: 250px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {opacity: 0; transform: scale(0.9);}
    to {opacity: 1; transform: scale(1);}
}

/* Spinner giratorio */
.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #757575;
    animation: spin 1s linear infinite;
}

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

/* Texto de carga */
.loading-content p {
    margin: 10px 0;
    color: #424242;
    font-size: 18px;
    font-weight: 500;
}

.loading-content .small-text {
    font-size: 14px;
    color: #757575;
    margin-top: 5px;
}

/* Mejorar visualización en dispositivos móviles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 15px;
    }
    
    form {
        grid-template-columns: 1fr;
    }
    
    .form-group.col-2 {
        grid-column: span 1;
    }
    
    .btn-container {
        display: flex;
        flex-direction: column;
    }
    
    .btn {
        margin: 5px 0;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .btn-secondary {
        margin-right: 0;
    }
    
    .welcome-message {
        padding: 15px;
        font-size: 15px;
    }
    
    .logo {
        max-width: 150px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    input, select, textarea {
        padding: 12px;
        font-size: 16px; /* Aumenta el tamaño para mayor facilidad en móviles */
    }
    
    .toggle-option {
        padding: 0; /* Sin padding en móvil */
        margin: 0; /* Sin margen en móvil */
    }
    
    .toggle-label {
        padding: 6px 0; /* Más padding vertical para facilitar el toque */
        font-size: 15px; /* Texto ligeramente más pequeño */
    }
    
    .toggle-switch {
        width: 46px; /* Ligeramente más grande para facilitar el toque */
        height: 22px;
    }
    
    .toggle-switch:before {
        width: 18px;
        height: 18px;
    }
    
    .toggle-checkbox:checked + .toggle-label .toggle-switch:before {
        transform: translateX(24px);
    }
    
    .modal-content {
        margin: 20% auto;
        width: 90%;
    }
    
    .loading-content {
        width: 220px;
        margin: 40% auto;
        padding: 20px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }
    
    .loading-content p {
        font-size: 16px;
    }
}

/* Optimizaciones adicionales para móviles muy pequeños */
@media (max-width: 480px) {
    .container {
        padding: 10px;
        margin: 10px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .welcome-message {
        font-size: 14px;
    }
    
    .form-section h2 {
        font-size: 18px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        line-height: 60px;
        font-size: 30px;
    }
    
    /* Para móviles muy pequeños */
    .toggle-label {
        font-size: 14px; /* Texto aún más pequeño */
    }
}

.toggle-checkbox {
    display: none;
}