/* wizard.css - Estilos Mejorados v3 (Layout Fix) */

.wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    display: none; /* Changed from flex to none, JS will handle display */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeInOverlay 0.3s ease-out;
}

.wizard-modal {
    background-color: var(--background-color, #fff);
    padding: 0; /* Remove padding here, apply to inner sections */
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column; /* Crucial for layout */
    position: relative;
    border: 1px solid var(--border-color, #ccc);
    transform: scale(0.95);
    opacity: 0;
    animation: zoomInModal 0.4s 0.1s ease-out forwards;
    overflow: hidden; /* Prevent content spill */
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomInModal {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Header Section - Title Styling */
.wizard-modal > h2[data-translate-key="wizard_title"] { /* Wizard Modal Title */
    padding: 30px 40px 20px 40px;
    margin: 0;
    color: var(--primary-action-color); /* Standardized */
    text-align: center;
    font-family: var(--font-headings); /* Standardized */
    font-size: 1.6rem; /* Appropriate for modal title */
    font-weight: 700; /* Standardized */
    text-transform: none; /* Standardized */
    flex-shrink: 0;
}

.wizard-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color-secondary, #aaa);
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}
.wizard-close-btn:hover {
    color: var(--danger-color, #dc3545);
    transform: scale(1.1);
}

/* Progress Bar Section */
ul#wizard-progress {
    padding: 0 40px 30px 40px;
    border-bottom: 1px solid var(--border-color-light, #eee);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0;
    list-style: none;
    position: relative;
}
ul#wizard-progress::before {
    content: '';
    position: absolute;
    top: 15px; /* Adjusted to align with center of circles */
    left: 10%; /* Start after the first circle roughly */
    width: 80%; /* Span across to before the last circle roughly */
    height: 2px;
    background-color: var(--border-color-light, #eee);
    z-index: 1; /* Behind the step circles */
}
.wizard-progress-step {
    text-align: center;
    color: var(--text-color-secondary, #aaa);
    font-size: 0.8rem;
    flex-basis: 14%; /* Adjust based on number of steps */
    flex-shrink: 0;
    position: relative; /* For z-index to work */
    z-index: 2; /* Above the progress line */
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default; /* Or pointer if steps are clickable */
}
.wizard-progress-step::before { /* The circle */
    content: attr(data-step-number);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--border-color-light, #eee); /* Default background */
    color: var(--text-color-secondary, #aaa);
    border: 2px solid var(--border-color-light, #eee);
    margin-bottom: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.wizard-progress-step.active {
    color: var(--primary-action-color, #007bff);
    font-weight: bold;
}
.wizard-progress-step.active::before {
    background-color: var(--background-color, #fff); /* Background of modal, or a light color */
    border-color: var(--primary-action-color, #007bff);
    color: var(--primary-action-color, #007bff);
}

.wizard-progress-step.completed {
    color: var(--success-color, #198754); /* Checkmark color */
}
.wizard-progress-step.completed::before {
    content: '\2713'; /* Checkmark unicode */
    background-color: var(--success-color, #198754);
    border-color: var(--success-color, #198754);
    color: white;
    font-size: 1rem; 
    line-height: 1; 
}


/* Steps Container (Main Content Area) */
#wizard-steps-container {
    flex-grow: 1; /* Allows this area to take up available space */
    overflow-y: auto; /* Scroll for content that exceeds max-height */
    padding: 25px 40px;
    min-height: 150px; /* Ensure a minimum height for content visibility */
}

.wizard-step {
    display: none; /* Hide steps by default */
    animation: stepFadeIn 0.5s ease-in-out;
}
.wizard-step.active {
    display: block; /* Show active step */
}
.wizard-step h3 { /* Wizard Step Titles */
    font-family: var(--font-headings, sans-serif); /* Standardized */
    font-size: 1.4rem; /* Standardized */
    font-weight: 700; /* Standardized */
    color: var(--primary-action-color); /* ESTANDARIZADO (was --text-color) */
    text-transform: none; /* Standardized */
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.wizard-step h3 .step-icon { 
    width: 24px;
    height: 24px;
    color: var(--primary-action-color);
    flex-shrink: 0;
}
.wizard-step p {
    color: var(--text-color-secondary, #666);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.wizard-step label { /* Wizard Input Labels */
    display: block;
    margin-bottom: 0.5rem; /* ESTANDARIZADO (was 8px) */
    font-weight: 700; /* ESTANDARIZADO (was bold) */
    color: var(--label-color); /* ESTANDARIZADO (was --text-color) */
    font-size: 0.9rem; /* Standardized */
    font-family: var(--font-headings); /* Standardized */
    text-transform: none; /* Standardized */
}
.wizard-step label.checkbox-label {
    font-weight: normal;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0; 
    color: var(--text-color); /* Checkbox labels might have different color than input labels */
    font-family: var(--font-primary); /* Keep primary for better readability if desired */
}
.wizard-step label.checkbox-label input[type="checkbox"] {
    width: auto; 
    margin-right: 0; 
    transform: scale(1.1);
    accent-color: var(--primary-action-color);
}
.wizard-step input[type="text"],
.wizard-step input[type="number"],
.wizard-step select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 5px; 
    font-size: 1rem;
    background-color: var(--sim-bg-input-accent, #f8f8f8);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wizard-step input:focus,
.wizard-step select:focus {
    border-color: var(--primary-action-color, #007bff);
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-color-translucent, rgba(196, 216, 46, 0.3));
    background-color: #fff; 
}
.wizard-step .wizard-input-group p { 
    font-size: 0.8rem;
    color: var(--text-color-secondary, #777);
    margin-top: 5px; 
    margin-bottom: 15px; 
}
.wizard-step hr.field-separator {
    border: none;
    border-top: 1px dashed var(--border-color-light, #eee);
    margin: 20px 0 15px 0; 
}

.wizard-input-group.optional-field label::after {
     font-size: 0.8em;
     font-weight: normal;
     color: var(--text-color-secondary);
     margin-left: 5px;
}
.wizard-input-group { 
    margin-bottom: 25px; 
}
.wizard-input-group label.checkbox-label { 
    margin-bottom: 5px; 
}


/* Navigation Buttons Container */
.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-top: 1px solid var(--border-color-light, #eee);
    flex-shrink: 0; 
    background-color: var(--background-color, #fff); 
}

.wizard-navigation .btn {
    padding: 12px 25px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 700; 
    border-radius: 8px; 
}
.wizard-navigation .btn svg { 
    width: 1em; 
    height: 1em; 
    margin-right: 0.5em;
    vertical-align: middle; 
}

.wizard-navigation .btn-secondary { 
     background-color: transparent;
     color: var(--primary-action-color);
     border: 1px solid var(--primary-action-color);
}
.wizard-navigation .btn-secondary:hover {
    background-color: var(--primary-action-color);
    color: white;
}

.wizard-navigation .btn-primary { 
     background-color: var(--primary-action-color);
     color: white;
     border-color: var(--primary-action-color);
}
.wizard-navigation .btn-primary:hover {
     background-color: var(--primary-action-hover);
     border-color: var(--primary-action-hover);
}
.wizard-navigation .btn-success {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}
.wizard-navigation .btn-success:hover {
    background-color: #157347; 
    border-color: #146c43; 
}

.wizard-navigation #wizard-prev-btn {
    visibility: hidden; 
}


/* Summary step styling */
.wizard-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dotted var(--border-color-light, #eee);
    font-size: 0.95rem;
}
.wizard-summary-item:last-child {
    border-bottom: none;
}
.wizard-summary-item .label {
    font-weight: bold;
    color: var(--text-color, #555); 
    margin-right: 15px;
    flex-basis: 40%; 
    white-space: normal; 
}
.wizard-summary-item .value {
    color: var(--text-color, #333);
    text-align: right;
    font-weight: 500; 
    flex-basis: 55%; 
    white-space: normal; 
}


/* Step Animation */
@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .wizard-modal {
        width: 95%;
        max-height: 95vh;
    }
    .wizard-modal > h2[data-translate-key="wizard_title"], 
    #wizard-steps-container, 
    .wizard-navigation,
    ul#wizard-progress { /* Added progress bar to responsive padding */
        padding-left: 20px;
        padding-right: 20px;
    }
     ul#wizard-progress { /* Specific adjustments for progress bar on small screens */
        padding-top: 15px; /* Add some top padding if needed */
        padding-bottom: 20px; /* Adjust bottom padding */
    }
    ul#wizard-progress::before {
        left: 5%; 
        width: 90%;
    }
    .wizard-progress-step {
        font-size: 0.7rem; /* Smaller text for step names */
    }
    .wizard-progress-step::before { /* Smaller circles */
        width: 24px;
        height: 24px;
        font-size: 0.8em; /* Adjust number size in circle */
    }
     .wizard-step h3 {
        font-size: 1.2rem; /* Slightly smaller step titles */
    }
    .wizard-step label {
        font-size: 0.85rem; /* Slightly smaller labels */
    }
}