/* Full-screen step-by-step wizard for create/edit beneficio and tramite forms */

.beneficio-wizard,
.tramite-wizard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: linear-gradient(135deg, var(--background-color) 0%, #eef0ff 100%);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.beneficio-wizard *,
.tramite-wizard * {
    box-sizing: border-box;
}

.wizard-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.wizard-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 220px;
}

.wizard-title i {
    font-size: 1.6rem;
    color: var(--accent-color);
}

.wizard-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.25rem;
}

.wizard-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: var(--on-surface-variant);
    font-size: 0.75rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.wizard-step-dot span {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--surface-variant);
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.wizard-step-dot.active span {
    background: var(--primary-color);
    color: var(--on-primary);
    box-shadow: 0 4px 12px rgba(5, 18, 110, 0.3);
}

.wizard-step-dot.completed span {
    background: var(--success-color);
    color: #fff;
}

.wizard-step-connector {
    width: 60px;
    max-width: 100px;
    height: 3px;
    background: var(--surface-variant);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.wizard-step-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.wizard-step-connector.completed::after {
    width: 100%;
}

.wizard-close {
    color: var(--on-surface-variant);
    font-size: 1.25rem;
    text-decoration: none;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wizard-close:hover {
    background: var(--surface-variant);
    color: var(--danger-color);
}

.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.wizard-form-wrapper {
    width: 100%;
    max-width: 900px;
}

.wizard-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-step-content.active {
    display: block;
}

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

.wizard-step-content .card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 1rem;
}

.wizard-step-title {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wizard-step-subtitle {
    color: var(--on-surface-variant);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.wizard-help-box {
    background: #ecfdf5;
    border-left: 4px solid var(--success-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-default);
    margin-bottom: 1.5rem;
    color: #065f46;
    font-size: 0.9rem;
}

.wizard-help-box i {
    margin-right: 0.5rem;
}

.wizard-field-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.wizard-field-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wizard-summary-item {
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius-default);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.wizard-summary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wizard-summary-item-title {
    font-weight: 700;
    color: var(--text-main);
}

.wizard-summary-item-meta {
    font-size: 0.85rem;
    color: var(--on-surface-variant);
}

.wizard-summary-empty {
    text-align: center;
    padding: 2rem;
    color: var(--on-surface-variant);
}

.wizard-summary-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--outline-color);
}

.wizard-footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.wizard-footer-actions {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.wizard-footer .btn {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
    justify-content: center;
}

.wizard-footer .btn-primary {
    background: var(--primary-color);
    color: var(--on-primary);
    border: none;
}

.wizard-footer .btn-secondary {
    background: var(--surface-variant);
    color: var(--text-main);
    border: none;
}

.wizard-footer .btn-success {
    background: var(--success-color);
    color: #fff;
    border: none;
}

.wizard-footer .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Relocate alerts inside wizard */
.wizard-body .alert {
    width: 100%;
    max-width: 900px;
    margin-bottom: 1rem;
}

/* Field builder adjustments for wizard */
.wizard-step-content .field-builder {
    min-height: 200px;
}

/* Summary cards grid */
.wizard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.wizard-summary-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-default);
    padding: 1.25rem;
}

.wizard-summary-card h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--on-surface-variant);
    margin-bottom: 0.5rem;
}

.wizard-summary-card p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.wizard-summary-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.wizard-summary-badge.active {
    background: #ecfdf5;
    color: var(--success-color);
}

.wizard-summary-badge.inactive {
    background: #ffebee;
    color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .wizard-title {
        min-width: auto;
        font-size: 1rem;
    }

    .wizard-steps-indicator {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .wizard-steps-indicator::-webkit-scrollbar {
        display: none;
    }

    .wizard-step-dot {
        flex-shrink: 0;
        font-size: 0.65rem;
    }

    .wizard-step-dot span {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }

    .wizard-step-connector {
        flex-shrink: 0;
        width: 20px;
    }

    .wizard-body {
        padding: 0.75rem;
        width: 100%;
    }

    .wizard-form-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .wizard-step-content {
        width: 100%;
        overflow-x: hidden;
    }

    .wizard-step-content .card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .wizard-step-title {
        font-size: 1.2rem;
    }

    .wizard-step-subtitle {
        font-size: 0.85rem;
    }

    .wizard-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .wizard-footer-actions {
        width: 100%;
        margin-left: 0;
        display: flex;
    }

    .wizard-footer .btn {
        flex: 1;
        min-width: auto;
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .wizard-step-dot small {
        display: none;
    }

    .wizard-step-connector {
        width: 15px;
    }

    .wizard-body {
        padding: 0.5rem;
    }

    .wizard-step-content .card {
        padding: 0.85rem;
    }
}

/* Tramite wizard compact version (not full-screen, fits in page) */
.tramite-wizard {
    position: relative;
    z-index: 1;
    background: transparent;
    height: auto;
    min-height: auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 1rem 0;
}

.tramite-wizard .wizard-header {
    padding: 0.5rem 1rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.tramite-wizard .wizard-title {
    font-size: 1rem;
    gap: 0.5rem;
}

.tramite-wizard .wizard-title i {
    font-size: 1.1rem;
}

.tramite-wizard .wizard-steps-indicator {
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 0;
    margin: 0 auto;
}

.tramite-wizard .wizard-step-dot {
    flex-shrink: 0;
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    color: transparent;
    font-size: 0;
    padding: 0;
}

.tramite-wizard .wizard-step-dot span {
    display: none;
}

.tramite-wizard .wizard-step-dot small {
    display: none;
}

.tramite-wizard .wizard-step-dot.active {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 20, 80, 0.15);
}

.tramite-wizard .wizard-step-dot.completed {
    background: var(--primary-color);
}

.tramite-wizard .wizard-step-connector {
    flex: 1;
    height: 2px;
    min-width: 8px;
    background: var(--border-color);
    margin: 0;
}

.tramite-wizard .wizard-step-connector.completed {
    background: var(--primary-color);
}

.tramite-wizard .wizard-close {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.9rem;
}

.tramite-wizard .wizard-body {
    padding: 0.75rem;
    overflow: visible;
    display: block;
    background: var(--background-color);
}

.tramite-wizard .wizard-form-wrapper {
    max-width: 100%;
}

.tramite-wizard .wizard-step-content .card {
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-default);
    box-shadow: var(--shadow-sm);
}

.tramite-wizard .wizard-step-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.tramite-wizard .wizard-step-subtitle {
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

.tramite-wizard .form-group {
    margin-bottom: 0.5rem;
}

.tramite-wizard .form-control {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    min-height: 38px;
}

.tramite-wizard select.form-control {
    padding: 0.4rem 0.5rem;
}

.tramite-wizard .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.tramite-wizard small {
    font-size: 0.75rem;
}

.tramite-wizard .wizard-footer {
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tramite-wizard .wizard-footer-actions {
    margin-left: auto;
    gap: 0.5rem;
    display: flex;
    align-items: center;
}

.tramite-wizard .wizard-footer .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: auto;
    flex: 0 0 auto;
    border-radius: var(--radius-default);
    white-space: nowrap;
}

.tramite-wizard .wizard-footer .btn i {
    margin-right: 0.3rem;
    font-size: 0.75rem;
}

.tramite-wizard .wizard-footer .btn-secondary {
    padding: 0.4rem 0.6rem;
}

.tramite-wizard .wizard-help-box {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    margin-bottom: 0.6rem;
}

.tramite-wizard .wizard-help-box ul {
    margin-top: 0.35rem;
}

.tramite-wizard .alert {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
}

.tramite-wizard .hijo-card {
    margin-bottom: 0.75rem !important;
    border-width: 1px !important;
}

.tramite-wizard .hijo-card > div:first-child {
    padding: 0.5rem 0.75rem !important;
}

.tramite-wizard .hijo-card > div:first-child h4 {
    font-size: 0.95rem !important;
}

.tramite-wizard .hijo-card > div:last-child {
    padding: 0.75rem !important;
}
