/* ===========================
   PAGE DÉMO - Layout
   =========================== */

/* Choix à gauche (1fr), formulaire à droite (2fr) */
.demo-wrapper {
    grid-template-columns: 1fr 2fr;
}

/* ===========================
   PAGE DÉMO - Choix de type
   =========================== */

.demo-type-selector {
    margin-bottom: 0;
}

.demo-type-selector h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.demo-types {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-type-option {
    cursor: pointer;
    display: block;
}

.demo-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.demo-type-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.demo-type-option input[type="radio"]:checked + .demo-type-card {
    border-color: var(--primary-color);
    background: #f8fbfd;
    box-shadow: 0 2px 8px rgba(26, 54, 66, 0.1);
}

.demo-type-option input[type="radio"]:checked + .demo-type-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    z-index: -1;
}

.demo-type-card:hover {
    border-color: var(--primary-color);
    background: #fafbfc;
}

.demo-type-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
}

.demo-type-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.demo-type-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.demo-legal-note {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 1rem;
    margin-bottom: 0;
    font-style: italic;
    line-height: 1.4;
}

/* Sélection de modules - Dropdown personnalisé */
.custom-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
}

.multiselect-trigger:hover {
    border-color: var(--primary-color);
}

.multiselect-trigger.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.multiselect-text {
    flex: 1;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.multiselect-text.placeholder {
    color: var(--text-light);
}

.multiselect-trigger i {
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.multiselect-trigger.active i {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.multiselect-dropdown.show {
    display: block;
}

.multiselect-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.multiselect-option:hover {
    background: #f8fbfd;
}

.multiselect-option input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.multiselect-option i {
    color: var(--primary-color);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.multiselect-option span {
    flex: 1;
}

.multiselect-option input[type="checkbox"]:checked ~ span {
    font-weight: 600;
    color: var(--primary-color);
}

.multiselect-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.multiselect-option.disabled:hover {
    background: var(--bg-white);
}

/* Responsive */
@media (max-width: 768px) {
    .demo-wrapper {
        grid-template-columns: 1fr;
    }

    #demo-choice-section {
        order: -1; /* Mettre le choix avant le formulaire sur mobile */
    }

    .demo-type-selector h2 {
        font-size: 1.1rem;
    }

    .demo-type-card {
        padding: 1.25rem;
    }

    .demo-type-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .demo-type-card h3 {
        font-size: 1rem;
    }

    .demo-type-card p {
        font-size: 0.85rem;
    }
}
