/* Variables CSS */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 25px 100px -12px rgba(37, 99, 235, 0.3);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--dark);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Background con imagen */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
        url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') 
        no-repeat center center fixed;
    background-size: cover;
    z-index: 1;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.1) 0%,
        rgba(139, 92, 246, 0.1) 100%);
}

/* Modal principal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease;
    position: relative;
    z-index: 2;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header del formulario */
.form-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo i {
    font-size: 2.5rem;
    opacity: 0.9;
}

.logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo h2 span {
    color: #fbbf24;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.2rem;
}

.header-message {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid #fbbf24;
}

.header-message i {
    color: #fbbf24;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.header-message p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Cuerpo del formulario */
form {
    padding: 2rem;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 1.5rem;
}

.question-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.question-number {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.question-label label {
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.question-label i {
    color: var(--primary);
}

/* Select personalizado */
.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    background: white;
    color: var(--dark);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select:invalid {
    color: var(--gray);
}

.select-wrapper i {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
}

/* Sección de contacto */
.contact-section {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.contact-section h3 {
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-section h3 i {
    color: var(--primary);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.input-group label i {
    color: var(--primary);
}

.input-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group input::placeholder {
    color: var(--gray);
}

/* Términos y condiciones */
.terms-group {
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-top: 0.2rem;
}

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
    opacity: 1;
}

.terms-text {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Botón de envío */
.form-actions {
    margin: 2rem 0;
}

.submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn i {
    font-size: 1.3rem;
}

.btn-subtext {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Información de seguridad */
.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.security-info i {
    color: var(--success);
}

/* Modal de éxito */
.success-content {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.success-content h2 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.success-message {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.success-message strong {
    color: var(--dark);
    display: block;
    margin-bottom: 0.5rem;
}

.success-details {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: left;
    margin-bottom: 2rem;
}

.success-details p {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.success-details i {
    color: var(--primary);
    width: 20px;
}

.success-details strong {
    font-weight: 600;
}

.close-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Overlay de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    max-width: 400px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spinner {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.loading-content p {
    color: var(--gray);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
    }
    
    .form-header,
    form {
        padding: 1.5rem;
    }
    
    .logo h2 {
        font-size: 1.5rem;
    }
    
    .success-content {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .modal-content {
        border-radius: var(--border-radius);
    }
    
    .header-message {
        flex-direction: column;
        text-align: center;
    }
}