/* CSS per Modern Clinic Form Wrapper */

:root {
    --mcfw-sidebar-bg: #1378c0; /* Blu del logo */
    --mcfw-sidebar-text: #ffffff;
    --mcfw-primary: #fba5a5; /* Rosa pastello per i titoli sidebar */
    --mcfw-accent: #ff0000; /* Rosso vivo per il pulsante */
    --mcfw-title: #1a1a1a;
    --mcfw-subtitle: #666666;
    --mcfw-border: #888888; /* Grigio del logo */
    --mcfw-input-bg: #fdfdfd;
    --mcfw-radius: 12px;
    --mcfw-shadow: 0 15px 50px rgba(0,0,0,0.12);
}

.mcfw-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 40px 0 !important;
    background: #fff;
    border-radius: var(--mcfw-radius);
    box-shadow: var(--mcfw-shadow);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.mcfw-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
}

/* Sidebar Styling */
.mcfw-sidebar {
    flex: 0 0 320px !important;
    background: var(--mcfw-sidebar-bg) !important;
    color: #ffffff !important;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mcfw-sidebar-title {
    color: #fba5a5 !important;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.mcfw-sidebar-subtitle {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 40px;
}

.mcfw-contact-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mcfw-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.mcfw-icon {
    background: rgba(255,255,255,0.1);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mcfw-icon svg {
    width: 20px;
    height: 20px;
}

.mcfw-text {
    display: flex;
    flex-direction: column;
}

.mcfw-text strong {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.mcfw-text a, .mcfw-text span {
    font-size: 1.1rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mcfw-text a:hover {
    color: #fba5a5 !important;
}

.mcfw-text small {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 4px;
}

.mcfw-sidebar-footer {
    margin-top: 60px;
    font-size: 0.85rem;
    opacity: 0.5;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

/* Form Area Styling */
.mcfw-form-area {
    flex: 1 !important;
    background: #fff;
    padding: 40px 50px; /* Ridotto padding verticale */
}

.mcfw-form-title {
    font-size: 1.6rem; /* Leggermente più piccolo per compattezza */
    font-weight: 700;
    color: var(--mcfw-title);
    margin-bottom: 5px;
}

.mcfw-form-header p {
    color: var(--mcfw-subtitle);
    margin-bottom: 25px; /* Spazio ridotto */
    font-size: 0.95rem;
}

.mcfw-gravity-wrapper .gfield_required,
.mcfw-gravity-wrapper .gfield_required_text {
    color: #fba5a5 !important;
    margin-left: 4px;
    font-weight: normal !important;
}

/* Gravity Forms Grid System - Forzatura */
.mcfw-gravity-wrapper .gform_fields {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
}

.mcfw-gravity-wrapper .gfield {
    flex: 1 1 calc(50% - 15px) !important; /* 2 campi per riga di base */
    min-width: 250px !important;
    margin-bottom: 5px !important;
}

/* Campi che devono stare a tutta larghezza */
.mcfw-gravity-wrapper .gfield--width-full,
.mcfw-gravity-wrapper .gfield--type-textarea,
.mcfw-gravity-wrapper .gfield--type-checkbox,
.mcfw-gravity-wrapper .gfield--type-captcha,
.mcfw-gravity-wrapper .gfield--type-captcha + .gfield {
    flex: 1 1 100% !important;
}

/* Ottimizzazione Textarea */
.mcfw-gravity-wrapper textarea {
    height: 120px !important;
    resize: vertical !important;
}

/* Checkbox Styling - Pulizia */
.mcfw-gravity-wrapper fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 10px 0 !important;
}

.mcfw-gravity-wrapper .ginput_container_checkbox .gchoice {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
}

.mcfw-gravity-wrapper .gchoice input[type="checkbox"] {
    margin-top: 4px !important;
    flex-shrink: 0 !important;
}

.mcfw-gravity-wrapper .gform-field-label--type-inline {
    font-size: 0.85rem !important;
    font-weight: normal !important;
    color: #444 !important;
    line-height: 1.4 !important;
}

.mcfw-gravity-wrapper .gform_footer {
    margin-top: 20px !important;
    padding: 0 !important;
}

.mcfw-gravity-wrapper .gform_button,
.mcfw-gravity-wrapper input[type="submit"] {
    background: #ff0000 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 15px 30px !important; /* Bottone più proporzionato */
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.mcfw-gravity-wrapper .gform_button:hover,
.mcfw-gravity-wrapper input[type="submit"]:hover {
    background: var(--mcfw-sidebar-bg) !important;
    transform: translateY(-1px) !important;
}

/* ==========================================================================
   Table of Contents (TOC) Modernization
   ========================================================================== */
#toc_container {
    background: #ffffff !important;
    border: 1px solid #e5e8ed !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05) !important;
    padding: 30px !important;
    margin-bottom: 40px !important;
    width: auto !important;
    min-width: 300px;
}

#toc_container .toc_title {
    color: var(--mcfw-sidebar-bg) !important; /* Blu istituzionale */
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #fba5a5 !important; /* Rosa pastello */
}

#toc_container p.toc_title {
    text-align: left !important;
}

#toc_container .toc_toggle {
    font-size: 0.8rem !important;
    font-weight: normal !important;
}

#toc_container .toc_toggle a {
    color: #888888 !important;
    text-decoration: none !important;
}

#toc_container .toc_toggle a:hover {
    color: #ee5253 !important;
}

#toc_container ul.toc_list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

#toc_container ul.toc_list li {
    margin-bottom: 10px !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
}

#toc_container ul.toc_list li a {
    color: var(--mcfw-sidebar-bg) !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
}

#toc_container ul.toc_list li a:hover {
    color: #ee5253 !important; /* Rosso vibrante al passaggio */
    transform: translateX(5px) !important;
}

#toc_container .toc_number {
    font-weight: 700 !important;
    margin-right: 8px !important;
    opacity: 0.4 !important;
}

/* Sottolivelli */
#toc_container ul.toc_list ul {
    margin-top: 8px !important;
    margin-left: 25px !important;
    padding-left: 15px !important;
    border-left: 1px solid #eee !important;
}

#toc_container ul.toc_list ul li {
    font-size: 0.9rem !important;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .mcfw-grid {
        flex-wrap: wrap !important;
    }
    .mcfw-sidebar {
        flex: 1 1 100% !important;
        padding: 40px 30px;
    }
    .mcfw-form-area {
        flex: 1 1 100% !important;
        padding: 40px 30px;
    }
}

/* ==========================================================================
   YARPP Related Posts - Modern Cards
   ========================================================================== */
.yarpp-cards-section {
    border-top: 1px solid #eee;
    padding-top: 50px;
    margin-top: 60px !important;
}

.mcfw-yarpp-card {
    background: #ffffff !important;
    border: 1px solid #e5e8ed !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.mcfw-yarpp-card:hover {
    box-shadow: 0 15px 35px rgba(19, 120, 192, 0.1) !important;
}

.mcfw-yarpp-card .uk-card-title {
    transition: color 0.3s ease;
}

.yarpp-card-link:hover .uk-card-title {
    color: #ee5253 !important; /* Vira al rosso della Clinica Villa */
}
