/* Smart Wizard Vertical Styles */
.wizard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Navigation Steps */
.nav-tabs.step-anchor {
    display: flex;
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-tabs.step-anchor .nav-item {
    margin-bottom: 12px;
    width: 100%;
}

.nav-tabs.step-anchor .nav-link {
    display: flex;
    align-items: center;
    padding: 14px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ececec;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.nav-tabs.step-anchor .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

.nav-tabs.step-anchor .nav-link:hover {
    border-color: #071B9F;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(7, 27, 159, 0.15);
}

.nav-tabs.step-anchor .nav-link:hover::before {
    background: #071B9F;
}

.nav-tabs.step-anchor .nav-link.active {
    border-color: #071B9F;
    background: linear-gradient(135deg, #071B9F 0%, #052973 100%);
    color: white;
    box-shadow: 0 8px 25px 0 rgba(7, 27, 159, 0.3);
}

.nav-tabs.step-anchor .nav-link.active::before {
    background: rgba(255, 255, 255, 0.3);
}

.nav-tabs.step-anchor .nav-link.done {
    border-color: #88d4e2;
    background: linear-gradient(135deg, #88d4e2 0%, #88d4e2 100%);
    color: #6b7280;
    box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.25);
}

.nav-tabs.step-anchor .nav-link.done::before {
    background: rgba(255, 255, 255, 0.3);
}

.nav-tabs.step-anchor .nav-link.done .step-number::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
    color: #6b7280;
}

.nav-tabs.step-anchor .nav-link.done .step-number {
    position: relative;
    color: transparent;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    margin-right: 12px;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    flex-shrink: 0;
}

.nav-link:not(.active):not(.done) .step-number {
    background: #d9dbdf;
    color: #6b7280;
}

.step-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.3;
    flex: 1;
}

/* Content Area */
.tab-content {
    flex: 1;
    min-height: 600px;
    margin-left: 0;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.tab-pane.active {
    display: block;
}

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

.tab-pane h3 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb5c;
}

/* Ensure consistent spacing for all form elements within tab-panes */
.tab-pane .uk-grid-small {
    margin: 0;
}

.tab-pane .uk-margin {
    margin-top: 20px;
}

/* Form Styles */
.uk-form-label {
    color: #374151;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

.uk-input, .uk-select, .uk-textarea {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.uk-input:focus, .uk-select:focus, .uk-textarea:focus {
    border-color: #071B9F;
    box-shadow: 0 0 0 3px rgba(7, 27, 159, 0.1);
    outline: none;
}

.uk-input.error, .uk-select.error, .uk-textarea.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* Radio buttons */
.uk-fieldset {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    background: #f9fafb;
}

.uk-legend {
    color: #374151;
    font-weight: 500;
    padding: 0 10px;
}

.uk-radio {
    margin-right: 8px;
    accent-color: #3b82f6;
}

/* Wizard Buttons */
.wizard-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding: 24px 0;
    border-top: 2px solid #e5e7eb5c;
}

.wizard-buttons .uk-button {
    padding: 5px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 120px;
}

.wizard-buttons .uk-button-default {
    background: #ffffff;
    color: #6b7280;
    border-color: #d1d5db;
}

.wizard-buttons .uk-button-default:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.wizard-buttons .uk-button-primary {
    background: linear-gradient(135deg, #071B9F 0%, #052973 100%);
    color: white;
    border-color: #071B9F;
}

.wizard-buttons .uk-button-primary:hover {
    background: linear-gradient(135deg, #052973 0%, #041e5c 100%);
    box-shadow: 0 4px 12px 0 rgba(7, 27, 159, 0.3);
    transform: translateY(-2px);
}

/* Error Messages */
.form-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-error::before {
    content: '⚠';
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .wizard-container {
        flex-direction: column;
        gap: 20px;
    }

    .nav-tabs.step-anchor {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 12px;
        scroll-behavior: smooth;
    }

    .nav-tabs.step-anchor::-webkit-scrollbar {
        height: 4px;
    }

    .nav-tabs.step-anchor::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .nav-tabs.step-anchor::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .nav-tabs.step-anchor .nav-item {
        margin-bottom: 0;
        min-width: 180px;
        flex-shrink: 0;
    }

    .nav-tabs.step-anchor .nav-link {
        padding: 12px 16px;
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin-right: 0;
        margin-bottom: 4px;
    }

    .step-title {
        font-size: 13px;
    }

    .tab-content {
        padding: 20px;
        min-height: 400px;
    }

    .tab-pane h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 640px) {
    .nav-tabs.step-anchor .nav-item {
        min-width: 120px;
    }

    .nav-tabs.step-anchor .nav-link {
        padding: 10px 8px;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 11px;
        margin-bottom: 2px;
    }

    .step-title {
        font-size: 11px;
        line-height: 1.2;
    }

    .tab-content {
        padding: 16px;
    }

    .tab-pane h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .wizard-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .wizard-buttons .uk-button {
        width: 100%;
        max-width: 300px;
    }

    /* Mejorar formularios en móvil */
    .uk-grid-small[uk-grid] > * {
        padding-left: 5px;
    }



    .uk-input, .uk-select, .uk-textarea {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Success States */
.field-success {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}

.field-success + .form-success {
    color: #10b981;
    font-size: 12px;
    margin-top: 4px;
}

.field-success + .form-success::before {
    content: '✓';
    margin-right: 4px;
}

/* Loading States */
.wizard-loading {
    opacity: 0.7;
    pointer-events: none;
}

.wizard-loading .uk-button {
    position: relative;
}

.wizard-loading .uk-button::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;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

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

/* Accessibility */
.nav-tabs.step-anchor .nav-link:focus {
    outline: 2px solid #071B9F;
    outline-offset: 2px;
}

.uk-input:focus, .uk-select:focus, .uk-textarea:focus {
    outline: 2px solid #071B9F;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .nav-tabs.step-anchor {
        display: none;
    }

    .wizard-buttons {
        display: none;
    }

    .tab-pane {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}
