/**
 * ESTILOS PARA AUTO-REGISTRO DE CL@VE
 * Wizard de múltiples pasos con validación
 */

/* ========================================
   MODAL DE AUTO-REGISTRO
   ======================================== */

.auto-registration-content {
    max-width: 900px !important;
    width: 90vw !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
}

/* ========================================
   HEADER
   ======================================== */

.auto-registration-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.auto-registration-header .header-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.auto-registration-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.auto-registration-header .subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* ========================================
   BARRA DE PROGRESO
   ======================================== */

.registration-progress {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.progress-steps .step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.progress-steps .step-number {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    background: #f5f5f5;
    color: #999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.progress-steps .step.active .step-number {
    background: #667eea;
    color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.progress-steps .step.completed .step-number {
    background: #4caf50;
    color: white;
}

.progress-steps .step.completed .step-number::after {
    content: '✓';
    font-weight: bold;
}

.progress-steps .step-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.progress-steps .step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.4s ease;
}

/* ========================================
   CONTENIDO DE PASOS
   ======================================== */

.registration-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #f9f9f9;
}

.registration-step {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.step-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.step-header .text-muted {
    margin: 0 0 20px 0;
    font-size: 14px;
}

/* ========================================
   FORMULARIO
   ======================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.form-grid .form-group {
    display: flex;
    flex-direction: column;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group .form-control,
.form-group .form-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group .form-control:focus,
.form-group .form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group .form-control[readonly] {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-group .form-text {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.form-group .form-text.text-success {
    color: #4caf50;
}

.form-check {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.form-check-label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

/* ========================================
   ALERTS E INFO BOXES
   ======================================== */

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: flex-start;
}

.alert-info {
    background: #e3f2fd;
    color: #1976d2;
}

.alert-success {
    background: #e8f5e9;
    color: #388e3c;
}

.alert-warning {
    background: #fff3e0;
    color: #f57c00;
}

.alert-danger {
    background: #ffebee;
    color: #d32f2f;
}

.info-box {
    padding: 15px 20px;
    background: #f5f5f5;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

/* ========================================
   FOOTER CON BOTONES
   ======================================== */

.registration-footer {
    background: white;
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.registration-footer .footer-info {
    color: #666;
    font-size: 14px;
}

.registration-footer .btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.registration-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.registration-footer .btn-secondary:hover {
    background: #5a6268;
}

.registration-footer .btn-primary {
    background: #667eea;
    color: white;
}

.registration-footer .btn-primary:hover {
    background: #5568d3;
}

.registration-footer .btn-success {
    background: #4caf50;
    color: white;
}

.registration-footer .btn-success:hover {
    background: #43a047;
}

.registration-footer .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .auto-registration-content {
        width: 95vw !important;
        max-height: 95vh;
    }
    
    .auto-registration-header {
        padding: 20px;
    }
    
    .auto-registration-header h2 {
        font-size: 22px;
    }
    
    .progress-steps {
        flex-wrap: wrap;
    }
    
    .progress-steps .step {
        flex: 0 0 50%;
        margin-bottom: 15px;
    }
    
    .progress-steps::before {
        display: none;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .registration-content {
        padding: 20px;
    }
    
    .registration-step {
        padding: 20px;
    }
    
    .registration-footer {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .registration-footer .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* ========================================
   ANIMACIONES
   ======================================== */

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

.registration-step {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   SECTION ACADÉMICOS (PASO 4)
   ======================================== */

.academic-section {
    margin-bottom: 30px;
}

.academic-section h5 {
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.academic-section p.text-muted {
    margin-bottom: 15px;
    font-size: 14px;
}

#reg_titulaciones_list,
#reg_idiomas_list {
    min-height: 60px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px dashed #ddd;
}

/* ========================================
   AUTOCOMPLETE DE ORGANISMOS
   ======================================== */

/* Asegurar que el contenedor del grupo tenga position relative */
.form-group {
    position: relative;
}

.organismo-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: -1px;
}

.organismo-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.organismo-result-item:hover {
    background-color: #f8f9ff;
}

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

.organismo-result-item.no-results {
    cursor: default;
    color: #999;
    text-align: center;
    padding: 20px;
}

.organismo-result-item.no-results:hover {
    background-color: white;
}

.organismo-nombre {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.organismo-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.organismo-codigo {
    font-size: 12px;
    color: #667eea;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.organismo-nif {
    font-size: 11px;
    color: #999;
    font-family: 'Courier New', monospace;
}

/* Estilo para el input cuando tiene un organismo seleccionado */
#reg_organismoSearch.selected {
    border-color: #667eea;
    background-color: #f8f9ff;
}
