/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #202124;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Header con logo */
.header {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    max-width: 120px;
    height: auto;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Botón de cerrar sesión */
.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.logout-btn:active {
    transform: translateY(0);
}

.logout-btn i {
    font-size: 1rem;
}

/* Responsive para el botón de logout */
@media (max-width: 768px) {
    .logout-btn {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .logout-btn span {
        display: none;
    }
    
    .logout-btn i {
        font-size: 1.1rem;
    }
}

/* Formulario */
.form {
    padding: 40px;
}

.form-section {
    margin-bottom: 30px;
}

.question-block {
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out;
}

.question-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 12px;
    line-height: 1.4;
}

.question-label .required-asterisk {
    color: #ea4335;
    font-weight: 600;
    margin-left: 4px;
}

.question-number {
    background: #1a73e8;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 12px;
    vertical-align: middle;
}

/* Inputs y selects */
.form-input, .form-select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
    background: #fafafa;
    cursor: pointer;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #1a73e8;
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-select:hover {
    border-color: #dadce0;
    background: white;
}

.form-select:focus {
    cursor: default;
}

.form-input::placeholder {
    color: #9aa0a6;
    font-style: italic;
}

/* Select personalizado */
.select-container {
    position: relative;
}

.select-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    pointer-events: none;
    transition: transform 0.3s ease;
    z-index: 1;
}

.form-select:focus + .select-icon {
    transform: translateY(-50%) rotate(180deg);
}

/* Ocultar la flecha nativa del select */
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    padding-right: 50px; /* Espacio para nuestro ícono personalizado */
}

/* Para Firefox */
.form-select::-moz-appearance {
    text-indent: 0.01px;
    text-overflow: '';
}

/* Para Webkit (Chrome, Safari, Edge) */
.form-select::-webkit-appearance {
    -webkit-appearance: none;
}

/* Radio buttons personalizados */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.radio-option:hover {
    border-color: #1a73e8;
    background: #f8f9ff;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #5f6368;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #1a73e8;
    background: #1a73e8;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-option input[type="radio"]:checked ~ .radio-text {
    color: #1a73e8;
    font-weight: 500;
}

.radio-text {
    font-size: 1rem;
    color: #202124;
    transition: all 0.3s ease;
}

/* Botón de envío */
.form-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e8eaed;
}

.submit-btn {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #1a73e8;
    margin-bottom: 16px;
}

.loading-spinner p {
    color: #5f6368;
    font-size: 1.1rem;
}

/* Modal de éxito */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    text-align: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e8eaed;
}

.success-icon {
    font-size: 3rem;
    color: #34a853;
    margin-bottom: 16px;
}

.modal-header h2 {
    color: #202124;
    font-size: 1.5rem;
    font-weight: 500;
}

.modal-body {
    padding: 20px 30px;
    text-align: center;
}

.modal-body p {
    color: #5f6368;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #1557b0;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .form {
        padding: 20px;
    }
    
    .question-block {
        margin-bottom: 24px;
    }
    
    .question-label {
        font-size: 1rem;
    }
    
    .form-input, .form-select {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .radio-option {
        padding: 10px 12px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .logo {
        max-width: 100px;
    }
    
    .question-number {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
        margin-right: 8px;
    }
    
    .radio-group {
        gap: 12px;
    }
}

/* Estados de validación */
.form-input.error, .form-select.error {
    border-color: #ea4335;
    background: #fef7f7;
}

.form-input.success, .form-select.success {
    border-color: #34a853;
    background: #f7fef7;
}

.error-message {
    color: #ea4335;
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* Estilos para SweetAlert más ancho */
.swal-wide {
    width: 500px !important;
    max-width: 90vw !important;
}

@media (max-width: 600px) {
    .swal-wide {
        width: 95vw !important;
        margin: 0 10px !important;
    }
}

/* ===== ESTILOS PARA PÁGINA DE LOGIN ===== */

/* Contenedor de login */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Header del login */
.login-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.login-header .logo-container {
    margin-bottom: 20px;
}

.login-header .logo {
    max-width: 120px;
    height: auto;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Formulario de login */
.login-form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: slideInUp 0.6s ease-out;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 8px;
}

.form-label i {
    margin-right: 8px;
    color: #1a73e8;
}

.input-help {
    font-size: 0.85rem;
    color: #5f6368;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-help i {
    color: #1a73e8;
}

/* Botón de login */
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    display: none;
}

/* Footer del login */
.login-footer {
    text-align: center;
    margin-top: 20px;
}

.help-text {
    font-size: 0.9rem;
    color: #5f6368;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.help-text i {
    color: #1a73e8;
}

/* Errores de campo */
.field-error {
    color: #ea4335;
    font-size: 0.85rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: fadeInUp 0.3s ease-out;
}

.field-error i {
    font-size: 0.8rem;
}

/* Estados de validación para login */
.login-form .form-input.error {
    border-color: #ea4335;
    background: #fef7f7;
}

.login-form .form-input.success {
    border-color: #34a853;
    background: #f7fef7;
}

/* Animaciones */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive para login */
@media (max-width: 600px) {
    .login-container {
        padding: 10px;
    }
    
    .login-form-container {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 1rem;
    }
    
    .login-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }
}
