/* ============================================
   FORMULARIO AUTORIZACIÓN ADUANERA - ESTILOS
   ============================================ */

/* Contenedor principal */
.formulario-aduanas-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.formulario-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #3498db;
}

.formulario-header h2 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
}

.formulario-header .subtitle {
    color: #7f8c8d;
    font-size: 16px;
}

/* Indicador de pasos */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 10px;
}

.step-item::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #ddd;
    z-index: -1;
}

.step-item:first-child::before {
    display: none;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #ecf0f1;
    color: #95a5a6;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step-item.active .step-number {
    background: #3498db;
    color: white;
    transform: scale(1.1);
}

.step-item.completed .step-number {
    background: #27ae60;
    color: white;
}

.step-label {
    display: block;
    font-size: 14px;
    color: #7f8c8d;
}

.step-item.active .step-label {
    color: #2c3e50;
    font-weight: bold;
}

/* Secciones del formulario */
.form-section {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

.form-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

/* Grupos de campos */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 15px;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

/* Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 13px;
    font-style: italic;
}

/* Firma digital */
.signature-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.signature-container {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

#signature-pad {
    border: 2px dashed #adb5bd;
    border-radius: 6px;
    cursor: crosshair;
    display: block;
    width: 100%;
    height: 200px;
    background: #ffffff;
    touch-action: none;
}

#signature-pad:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.signature-actions {
    margin-top: 12px;
    text-align: center;
}

#clear-signature {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

#clear-signature:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

#signature-error {
    margin-top: 10px;
    padding: 12px;
    background: #fee;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    color: #c0392b;
    font-weight: 600;
}

/* Archivos */
.documents-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #dfe6e9;
    border-radius: 6px;
    cursor: pointer;
    background: #f8f9fa;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input[type="file"]:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.file-name {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
}

.doc-icon {
    font-size: 20px;
    margin-right: 5px;
}

/* Mensajes de alerta */
.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 14px;
    color: #856404;
}

.info-message {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #0d47a1;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    transition: all 0.3s;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

/* Botones */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.btn-primary,
.btn-secondary,
.btn-submit,
.btn-clear {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary,
.btn-submit {
    background: #3498db;
    color: white;
}

.btn-primary:hover,
.btn-submit:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-submit {
    background: #27ae60;
}

.btn-submit:hover {
    background: #229954;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Mensajes de respuesta */
#form-response {
    margin-top: 20px;
}

.success-message,
.error-message,
.loading {
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #bee5eb;
    position: relative;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 768px) {
    .formulario-aduanas-container {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .formulario-header h2 {
        font-size: 22px;
    }
    
    .steps-indicator {
        padding: 0 5px;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        line-height: 35px;
    }
    
    .form-row,
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    #signature-pad {
        height: 150px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .formulario-aduanas-container {
        padding: 15px;
    }
    
    .step-item::before {
        display: none;
    }
}

/* Impresión */
@media print {
    .formulario-aduanas-container {
        box-shadow: none;
    }
    
    .steps-indicator,
    .form-actions,
    button {
        display: none;
    }
}