/* Multi-Step Form Styles */

/* Form Steps - Clean and Simple */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

/* Ensure only the active step is visible */
.form-step:not(.active) {
    display: none !important;
}

/* Initial step display */
.form-step[data-step="1"]:not(.active) {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Step Indicators */
.step-indicator.active .step-circle {
    background-color: #f97316 !important;
    color: white !important;
}

.step-indicator.completed .step-circle {
    background-color: #16a34a !important;
    color: white !important;
}

.step-indicator.active .step-label {
    color: #f97316 !important;
    font-weight: 600;
}

.step-indicator.completed .step-label {
    color: #16a34a !important;
    font-weight: 600;
}

/* Step Options */
.step-option {
    transition: all 0.3s ease;
}

.step-option.selected {
    border-color: #f97316;
    background-color: #fff7ed;
}

.step-option:hover {
    border-color: #f97316;
    background-color: #fff7ed;
}

/* ============================================
   PROGRESS BAR — TF v2
   Struttura: .tf-progress-bar > .tf-pb-track + .tf-pb-step[]
   ============================================ */

.tf-progress-bar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 4px;
}

/* Linea singola assoluta, centrata sui cerchi (h=36px → centro=18px + pt=4px = 22px) */
.tf-pb-track {
    position: absolute;
    top: 22px;
    left: calc(100% / 16);   /* ~metà del primo slot */
    right: calc(100% / 16);
    height: 2px;
    background-color: #e5e7eb;
    z-index: 0;
    border-radius: 2px;
}

.tf-pb-fill {
    height: 100%;
    width: 0%;
    background-color: #f97316;
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* Ogni step occupa slot uguale */
.tf-pb-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.tf-pb-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.tf-pb-label {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    line-height: 1.4;
    min-height: 32px;
    display: block;
    transition: color 0.3s ease;
}

/* Stato: attivo */
.tf-pb-step.active .tf-pb-circle {
    background-color: #f97316 !important;
    color: #fff !important;
    box-shadow: 0 0 0 4px rgba(249,115,22,0.18);
}

.tf-pb-step.active .tf-pb-label {
    color: #f97316 !important;
    font-weight: 700;
}

/* Stato: completato */
.tf-pb-step.completed .tf-pb-circle {
    background-color: #16a34a !important;
    color: #fff !important;
}

.tf-pb-step.completed .tf-pb-label {
    color: #16a34a !important;
    font-weight: 600;
}

/* Progress Lines (legacy — mantenuto per compatibilità) */
.progress-line {
    background-color: #e5e7eb;
    transition: background-color 0.3s ease;
}

.progress-line.completed {
    background-color: #16a34a;
}

/* Error States */
.border-red-500 {
    border-color: #ef4444 !important;
}

.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

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

/* Button Styles */
.btn-primary {
    background-color: #f97316;
    color: white;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #ea580c;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    border: 1px solid #6b7280;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #4b5563;
    border-color: #4b5563;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .form-step {
        padding: 1rem;
    }

    .step-option {
        margin-bottom: 1rem;
    }

    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.p-4 { padding: 1rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
