/* ==========================================
   ESTILOS COMUNES PARA FORMULARIOS TUDETIC
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================
   TÍTULOS Y ENCABEZADOS
   ========================================== */

.page-title {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 600;
}

.page-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}

h2.section-title {
    color: #333;
    text-align: center;
    margin: 30px 0 15px 0;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
}

/* ==========================================
   CONTENEDORES Y TARJETAS
   ========================================== */

.form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    margin: -25px -25px 20px -25px;
    border-radius: 15px 15px 0 0;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
}

/* ==========================================
   GRUPOS DE FORMULARIO
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.form-group .label-info {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    font-weight: normal;
}

/* ==========================================
   INPUTS Y CONTROLES
   ========================================== */

.form-control,
input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================
   BOTONES
   ========================================== */

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.btn-warning:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

/* ==========================================
   IMÁGENES
   ========================================== */

.img-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.img-container {
    text-align: center;
    margin: 15px 0;
}

/* ==========================================
   MENSAJES DE ESTADO
   ========================================== */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* ==========================================
   GRID Y LAYOUT RESPONSIVE
   ========================================== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 10px;
}

.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 10px;
}

.col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 10px;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* ==========================================
   INPUT GROUP (Input con botón)
   ========================================== */

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

.input-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ==========================================
   FILE UPLOAD
   ========================================== */

.file-upload-wrapper {
    position: relative;
    margin-top: 10px;
}

.file-upload-wrapper input[type="file"] {
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    cursor: pointer;
}

.file-upload-wrapper input[type="file"]:hover {
    border-color: #764ba2;
    background-color: #f8f9ff;
}

/* ==========================================
   TABLAS RESPONSIVE
   ========================================== */

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.table tr:hover {
    background-color: #f8f9ff;
}

/* ==========================================
   UTILIDADES
   ========================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 10px;
}

/* ==========================================
   RESPONSIVE - MOBILE FIRST
   ========================================== */

@media screen and (max-width: 768px) {
    .card {
        padding: 20px 15px;
    }
    
    .card-header {
        margin: -20px -15px 15px -15px;
        padding: 12px 15px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .btn {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .form-container {
        padding: 10px;
    }
    
    .card {
        border-radius: 10px;
    }
}
