/* ===================================
   ARCHIVO: assets/css/forms.css
   Estilos para formularios de registro
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.form-container {
    max-width: 800px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
}

.form-container h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-description {
    color: #666;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert h3, .alert h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

/* Formulario */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 0;
}

legend {
    font-weight: 600;
    color: #2c3e50;
    padding: 0 0.5rem;
    font-size: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

input::placeholder {
    color: #999;
}

select {
    background-color: white;
    cursor: pointer;
}

/* Validación visual */
input:invalid {
    border-color: #e74c3c;
}

input:valid {
    border-color: #27ae60;
}

/* Botones */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

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

/* Aviso importante */
.form-notice {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 0 4px 4px 0;
}

.form-notice p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    fieldset {
        padding: 1rem;
    }
    
    .form-container {
        padding: 1rem;
    }
}

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

.form-container {
    animation: fadeIn 0.5s ease-out;
}

/* Estados de carga */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mejoras para accesibilidad */
input:focus,
select:focus,
button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Indicadores requeridos */
label[for] {
    cursor: pointer;
}

input:required + label::after,
select:required + label::after {
    content: ' *';
    color: #e74c3c;
}