/* Sobrescribir SOLO el contenedor de registro - MUY ESPECÍFICO */
.registro-page .registro-container {
    max-width: 500px; /* Móvil por defecto */
}

@media (min-width: 768px) {
    .registro-page .registro-container {
        max-width: 1200px !important; /* Forzar ancho para PC SOLO en registro */
        padding: 20px 40px !important;
    }
}

@media (min-width: 1024px) {
    .registro-page .registro-container {
        max-width: 1400px !important; /* Forzar ancho para pantallas grandes SOLO en registro */
        padding: 20px 60px !important;
    }
}

/* Estilos adicionales para el registro */
.register-form {
    max-width: none; /* Sin límite, usa el del contenedor */
    margin: 0 auto;
    padding: 30px 20px;
}

/* Estilos específicos para PC */
@media (min-width: 768px) {
    .register-form {
        padding: 50px 60px;
        margin: 20px auto;
    }
}

@media (min-width: 1024px) {
    .register-form {
        padding: 60px 80px;
    }
}

.register-form .logo-container p {
    color: #ff0000;
    font-weight: 600;
}

/* Grid layout para campos en PC */
@media (min-width: 768px) {
    .form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        align-items: start;
    }
    
    /* Organización específica de campos por posición */
    .input-group:nth-child(1) { /* Correo @seamosgenios.com */
        grid-column: 1;
    }
    
    .input-group:nth-child(2) { /* Correo de recuperación */
        grid-column: 2;
    }
    
    .input-group:nth-child(3) { /* Contraseña */
        grid-column: 1;
    }
    
    .input-group:nth-child(4) { /* Confirmar Contraseña */
        grid-column: 2;
    }
    
    .input-group:nth-child(5) { /* Nombre completo */
        grid-column: 1 / -1; /* Ocupa toda la fila */
    }
    
    .input-group:nth-child(6) { /* Teléfono */
        grid-column: 1;
    }
    
    .input-group:nth-child(7) { /* Institución */
        grid-column: 2;
    }
    
    .input-group:nth-child(8) { /* Grado */
        grid-column: 1;
    }
    
    .input-group:nth-child(9) { /* Tipo Documento */
        grid-column: 2;
    }
    
    .input-group:nth-child(10) { /* Número Documento */
        grid-column: 1;
    }
    
    .input-group:nth-child(11) { /* Departamento */
        grid-column: 2;
    }
    
    /* Términos y botones ocupan toda la fila */
    .terms-container,
    .register-btn,
    .form-links {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .form {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 25px;
    }
    
    /* Reorganización para 3 columnas en pantallas grandes */
    .input-group:nth-child(1) { /* Correo @seamosgenios.com */
        grid-column: 1;
    }
    
    .input-group:nth-child(2) { /* Correo de recuperación */
        grid-column: 2;
    }
    
    .input-group:nth-child(3) { /* Contraseña */
        grid-column: 3;
    }
    
    .input-group:nth-child(4) { /* Confirmar Contraseña */
        grid-column: 1;
    }
    
    .input-group:nth-child(5) { /* Nombre completo */
        grid-column: 2 / -1; /* Ocupa 2 columnas */
    }
    
    .input-group:nth-child(6) { /* Teléfono */
        grid-column: 1;
    }
    
    .input-group:nth-child(7) { /* Institución */
        grid-column: 2;
    }
    
    .input-group:nth-child(8) { /* Grado */
        grid-column: 3;
    }
    
    .input-group:nth-child(9) { /* Tipo Documento */
        grid-column: 1;
    }
    
    .input-group:nth-child(10) { /* Número Documento */
        grid-column: 2;
    }
    
    .input-group:nth-child(11) { /* Departamento */
        grid-column: 3;
    }
}

/* Estilos para los select */
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #333333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.input-group select:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.input-group select option {
    padding: 10px;
    background: #ffffff;
    color: #333333;
}

/* Validación para selects */
.input-group select.invalid {
    border-color: #ff0000 !important;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1) !important;
}

.input-group select.valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.terms-container {
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #ff0000;
    background: #ff0000;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.register-btn {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    margin-bottom: 25px;
}

.register-btn:hover {
    background: linear-gradient(135deg, #cc0000, #990000);
}

.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.message.success {
    background: rgba(0, 128, 0, 0.1);
    color: #008000;
    border: 1px solid rgba(0, 128, 0, 0.3);
    display: block;
}

.message.error {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
    border: 1px solid rgba(255, 0, 0, 0.3);
    display: block;
}

.message.info {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
    display: block;
}

/* Validación de campos */
.input-group input.invalid {
    border-color: #ff0000 !important;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1) !important;
}

.input-group input.valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.input-group .validation-message {
    font-size: 12px;
    margin-top: 5px;
    color: #ff0000;
    display: none;
}

.input-group .validation-message.show {
    display: block;
}

/* Mejoras adicionales para el diseño */
.input-group {
    margin-bottom: 0; /* Removemos margin por defecto para grid */
}

/* Estilos mejorados para PC */
@media (min-width: 768px) {
    .input-group {
        margin-bottom: 0;
    }
    
    /* Mejorar espaciado del logo */
    .logo-container {
        margin-bottom: 40px;
    }
    
    /* Mejorar botón */
    .register-btn {
        margin-top: 20px;
        padding: 16px;
        font-size: 18px;
    }
    
    /* Términos centrados */
    .terms-container {
        margin: 30px 0 20px 0;
        justify-content: center;
    }
    
    /* Centrar enlaces en PC */
    .form-links {
        text-align: center;
        justify-content: center;
    }
}

/* Animaciones suaves */
.input-group input,
.input-group select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:focus,
.input-group select:focus {
    transform: translateY(-1px);
}

/* Sombra para el formulario en PC */
@media (min-width: 768px) {
    .register-form {
        box-shadow: 
            0 25px 50px rgba(255, 0, 0, 0.15),
            0 0 0 1px rgba(255, 0, 0, 0.05);
    }
}

/* Estilos para el botón de mostrar/ocultar contraseña */
.password-toggle {
    position: absolute;
    right: 12px;
    top: calc(50% + 11px); /* Ajuste para centrar en el input considerando el label */
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666666;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
}

.password-toggle:focus {
    outline: 2px solid rgba(255, 0, 0, 0.3);
    outline-offset: 2px;
}

/* Ajustar padding del input cuando hay botón toggle */
.input-group:has(.password-toggle) input {
    padding-right: 45px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .register-form {
        max-width: 100%;
        padding: 30px 20px;
    }
    
    .form {
        display: block; /* Volver a layout normal en móvil */
    }
    
    .input-group {
        margin-bottom: 20px; /* Restaurar margin en móvil */
    }
    
    .terms-container {
        margin: 15px 0;
        justify-content: flex-start;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
    
    .register-btn {
        margin-top: 10px;
        padding: 14px;
        font-size: 16px;
    }
    
    .password-toggle {
        font-size: 14px;
        right: 10px;
    }
}