/* Formulario PILAR - Sistema de Estilos Unificado */
/* Basado en STYLE_GUIDE.md */

/* ===== VARIABLES CSS ===== */
:root {
    /* Colores Principales */
    --color-primary: #607D8B;
    --color-accent: #78909C;
    --color-dark: #37474F;
    --color-text: #455A64;
    --color-muted: #90A4AE;
    
    /* Colores de Fondo */
    --color-background: #F5F7F8;
    --color-light: #ECEFF1;
    --color-border: #CFD8DC;
    
    /* Colores Semánticos */
    --color-success: #81C784;
    --color-info: #4FC3F7;
    --color-warning: #FFD54F;
    --color-danger: #EF9A9A;
    
    /* Espaciado y Bordes */
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 8px;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.07);
    
    /* Transiciones */
    --transition: all 0.2s ease;
}

/* ===== TIPOGRAFÍA ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

body {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-background);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-dark);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.1rem; color: var(--color-muted); }

/* ===== COMPONENTES PRINCIPALES ===== */

/* Tarjetas */
.simple-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.simple-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow);
}

/* Panel Simple */
.simple-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    vertical-align: middle;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-light);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

/* Formularios */
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text);
    background: #fff;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.15rem rgba(96, 125, 139, 0.25);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Estados e Indicadores */
.status-success {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-warning {
    background: #FFF8E1;
    color: #F57F17;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-danger {
    background: #FFEBEE;
    color: #C62828;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-info {
    background: #E3F2FD;
    color: #1976D2;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Tablas */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background: transparent;
    border-collapse: collapse;
}

.table thead th {
    background: var(--color-light);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    color: var(--color-dark);
    padding: 0.75rem;
    text-align: left;
}

.table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.table tbody tr:hover {
    background: rgba(96, 125, 139, 0.05);
}

/* Navegación */
.navbar {
    background: var(--color-primary);
    min-height: 60px;
    box-shadow: var(--shadow);
    padding: 0 1rem;
    display: flex;
    align-items: center;
}

.nav-link {
    color: #c0ccd6;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Alertas */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 500;
}

.alert-success {
    color: #2E7D32;
    background: #E8F5E9;
    border-color: var(--color-success);
}

.alert-warning {
    color: #F57F17;
    background: #FFF8E1;
    border-color: var(--color-warning);
}

.alert-danger {
    color: #C62828;
    background: #FFEBEE;
    border-color: var(--color-danger);
}

.alert-info {
    color: #1976D2;
    background: #E3F2FD;
    border-color: var(--color-info);
}

/* Utilidades */
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-muted); }
.text-dark { color: var(--color-dark); }

.bg-light { background: var(--color-light); }
.bg-primary { background: var(--color-primary); }

.border-primary { border-color: var(--color-primary); }

.mb-lg { margin-bottom: 2rem; }
.mt-lg { margin-top: 2rem; }
.py-lg { padding: 2rem 0; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Focus states para accesibilidad */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .simple-panel {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .simple-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .navbar {
        flex-direction: column;
        min-height: auto;
        padding: 1rem;
    }
}

/* ===== ESTILOS ESPECÍFICOS PARA FORMULARIOS ===== */

/* Container principal del formulario */
.formulario-container {
    max-width: 900px;
    margin: 20px auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Header del formulario */
.formulario-header {
    background: var(--color-primary);
    color: white;
    padding: 2rem;
    text-align: center;
}

.formulario-header h1 {
    color: white;
    margin-bottom: 0.5rem;
}

.formulario-header .subtitle {
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.programa-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Contenido del formulario */
.formulario-content {
    padding: 2rem;
}

/* Secciones del formulario */
.formulario-section {
    background: var(--color-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-border);
}

.section-icon {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 1rem;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 1.2rem;
    color: var(--color-dark);
    font-weight: 600;
    margin: 0;
}

/* Campos de formulario específicos */
.formulario-section .form-group {
    margin-bottom: 1.5rem;
}

.formulario-section .form-label {
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.required-asterisk {
    color: var(--color-danger);
    margin-left: 0.25rem;
}

.formulario-section .form-control {
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid var(--color-border);
}

.formulario-section .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(96, 125, 139, 0.1);
}

.formulario-section textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Sección de equipo */
.team-section {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.team-member {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: var(--color-light);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.team-member .form-group {
    margin-bottom: 0;
}

.team-remove-btn {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.team-remove-btn:hover {
    background: #C62828;
    transform: translateY(-1px);
}

.team-add-btn {
    background: var(--color-success);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.team-add-btn:hover {
    background: #2E7D32;
    transform: translateY(-1px);
}

/* Estadísticas de team/dates */
.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(96, 125, 139, 0.1);
    border-radius: var(--radius);
    color: var(--color-primary);
    font-weight: 500;
}

/* Sección de fechas */
.date-input {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: var(--color-light);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.date-input .form-group {
    flex: 1;
    margin-bottom: 0;
}

.date-remove-btn {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.date-remove-btn:hover {
    background: #C62828;
    transform: translateY(-1px);
}

.dates-add-btn {
    background: var(--color-info);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dates-add-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

/* Sección de firma */
.signature-section {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.signature-canvas {
    border: 2px dashed var(--color-primary);
    border-radius: var(--radius);
    cursor: crosshair;
    background: white;
    transition: var(--transition);
}

.signature-canvas:hover {
    border-color: var(--color-dark);
    box-shadow: 0 0 0 3px rgba(96, 125, 139, 0.1);
}

/* Botón de envío */
.submit-section {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: var(--color-light);
    border-radius: var(--radius);
}

.btn-submit {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-submit:hover {
    background: var(--color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.btn-submit:disabled {
    background: var(--color-muted);
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.loading {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.spinner {
    border: 4px solid var(--color-light);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ===== RESPONSIVE PARA FORMULARIOS ===== */
@media (max-width: 768px) {
    .formulario-container {
        margin: 10px;
        border-radius: var(--radius);
    }
    
    .formulario-header {
        padding: 1.5rem;
    }
    
    .formulario-content {
        padding: 1rem;
    }
    
    .formulario-section {
        padding: 1rem;
    }
    
    .team-member {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .date-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .section-icon {
        margin: 0;
    }
}

/* ===== CONFIRMACIÓN PAGE ===== */
.confirmacion-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 2rem auto;
    animation: slideUp 0.6s ease-out;
}

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

.success-icon {
    background: var(--color-success);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.confirmacion-details {
    background: var(--color-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--color-success);
}

.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item i {
    color: var(--color-success);
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.footer-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.9rem;
}