/* ==========================================================================
   STILI FRONT-END DEL FORM CF7 GENERATO
   ========================================================================== */

/* Il contenitore si basa sulle custom variables passate inline dal JS */
.cf7ub-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--row-gap, 25px); /* Spazio tra le righe / step */
    width: 100%;
    box-sizing: border-box;
}

/* Allineamento righe */
.cf7ub-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
    gap: var(--row-gap, 25px) 0; /* Spazio verticale in caso di wrap */
}

/* Colonne e Spaziatura Campi Interni */
[class*="cf7ub-col-"] {
    padding-right: 10px;
    padding-left: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--field-gap, 15px); /* Spazio orizzontale e verticale tra i campi */
}

/* Definizione larghezze colonne standard */
.cf7ub-col-12 { width: 100%; }
.cf7ub-col-6  { width: 50%; }
.cf7ub-col-4  { width: 33.3333%; }
.cf7ub-col-3  { width: 25%; }

@media (max-width: 768px) {
    [class*="cf7ub-col-"] {
        width: 100% !important; /* Mobile responsive */
    }
}

/* ==========================================================================
   FORZATURA CAMPI AL 100% DEL LORO SPAZIO DISPONIBILE
   ========================================================================== */
.cf7ub-input-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Rende i campi nativi di Contact Form 7 larghi al 100% del wrapper */
.cf7ub-input-wrapper input[type="text"],
.cf7ub-input-wrapper input[type="email"],
.cf7ub-input-wrapper input[type="tel"],
.cf7ub-input-wrapper input[type="password"],
.cf7ub-input-wrapper input[type="number"],
.cf7ub-input-wrapper input[type="date"],
.cf7ub-input-wrapper select,
.cf7ub-input-wrapper textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Anche il pulsante di submit deve allinearsi al 100% dello spazio o allinearsi */
.cf7ub-submit {
    width: 100% !important;
    display: block !important;
}

/* ==========================================================================
   ELEMENTI COMPLEMENTARI (PRESERVAZIONE EXTRA E MULTI-STEP)
   ========================================================================== */
.cf7ub-reading-time {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cf7ub-progress-container {
    margin-bottom: 20px;
    width: 100%;
}
.cf7ub-bar-outer {
    background-color: #e2e8f0;
    border-radius: 9999px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}
.cf7ub-bar-inner {
    background-color: var(--primary-color, #3b82f6);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}
.cf7ub-percentage-text {
    font-weight: 600;
    color: var(--primary-color, #3b82f6);
}
.cf7ub-steps-indicator {
    display: flex;
    gap: 8px;
}
.cf7ub-steps-indicator .step-dot {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 500;
}
.cf7ub-steps-indicator .step-dot.active {
    background: var(--primary-color, #3b82f6);
    color: #ffffff;
}
.cf7ub-step {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.cf7ub-step-nav {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.cf7ub-step-nav button {
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--bg-color, #ffffff);
    color: #1e293b;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.cf7ub-step-nav button:hover {
    background: #f1f5f9;
}
.cf7ub-step-nav .cf7ub-next-btn {
    background: var(--primary-color, #3b82f6);
    color: #ffffff;
    border: none;
}
.cf7ub-step-nav .cf7ub-next-btn:hover {
    opacity: 0.9;
}
.toggle-password-visibility {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748b;
    font-size: 18px;
    display: flex;
    align-items: center;
    z-index: 5;
}