.community-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 45%, #f9fafb 100%);
}

.community-hero {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    color: #fff;
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 18px 45px rgba(29, 78, 216, 0.25);
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.community-card {
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 1rem;
    transition: transform .2s ease, box-shadow .2s ease;
}

.community-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* Témoignages */
.testimonial-section {
    position: relative;
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    color: #fff;
    padding: 3rem 0;
}

.testimonials-container {
    position: relative;
    overflow: hidden;
    margin: 1.5rem auto;
    max-width: 620px;
    padding: 0 8px;
    perspective: 1200px;
}

.testimonials-wrapper {
    position: relative;
    display: block !important;
    min-height: 440px;
    overflow: visible;
}

.testimonials-wrapper.layout-desktop {
    display: flex !important;
    align-items: stretch;
    min-height: 370px;
    transition: transform .68s cubic-bezier(.22,.61,.36,1);
    will-change: transform;
}

.testimonial-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
    float: none !important;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    background: #fff;
    color: #0f172a;
    border-radius: 18px;
    padding: 1.15rem 1.15rem 1rem;
    min-height: clamp(340px, 48vh, 460px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.12);
    transition: transform .72s cubic-bezier(.19,1,.22,1), opacity .48s ease, box-shadow .48s ease, filter .48s ease;
    transform-origin: top center;
    pointer-events: none;
    will-change: transform, opacity;
    box-sizing: border-box;
}

.testimonials-wrapper.layout-desktop .testimonial-card {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    flex: 0 0 100%;
    min-height: clamp(320px, 44vh, 430px);
    opacity: 1;
    pointer-events: auto;
    filter: none;
    transform: none !important;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.18);
}

.testimonials-wrapper.touch-dragging .testimonial-card.stack-active {
    transition: none;
}

.testimonial-card.stack-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotateX(0deg) rotateY(0deg);
    z-index: 30;
    pointer-events: auto;
    box-shadow: 0 20px 44px rgba(2, 6, 23, 0.24);
    filter: blur(0);
}

.testimonial-card.stack-next-1 {
    opacity: 0.92;
    transform: translate3d(0, 20px, -30px) scale(0.97) rotateX(2.4deg) rotateY(-8deg);
    z-index: 20;
    filter: blur(0.15px);
}

.testimonial-card.stack-next-2 {
    opacity: 0.78;
    transform: translate3d(0, 40px, -60px) scale(0.94) rotateX(4deg) rotateY(-14deg);
    z-index: 10;
    filter: blur(0.35px);
}

.testimonial-card.stack-hidden {
    opacity: 0;
    transform: translate3d(0, 78px, -90px) scale(0.9) rotateX(6deg) rotateY(-18deg);
    z-index: 0;
    filter: blur(0.45px);
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    object-fit: cover;
}

.testimonial-info h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.testimonial-info p {
    font-size: .8rem;
    color: #64748b;
    margin: 0;
}

.testimonial-rating {
    margin: .6rem 0;
}

.testimonial-rating .star {
    color: #e2e8f0;
    font-size: 1rem;
}

.testimonial-rating .star.filled {
    color: #f59e0b;
}

.testimonial-content {
    font-size: .98rem;
    line-height: 1.6;
    color: #1f2937;
    margin-top: .2rem;
    flex: 1 1 auto;
}

.testimonial-date {
    display: block;
    margin-top: .95rem;
    color: #6b7280;
    font-size: .75rem;
}

.testimonial-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0;
}

.testimonial-btn {
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.testimonial-btn:hover {
    background: rgba(255,255,255,.26);
}

.testimonial-dots {
    display: flex;
    justify-content: center;
    gap: .45rem;
    margin: .8rem 0 1.2rem;
}

.testimonial-dot {
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    background: rgba(255,255,255,.4);
    cursor: pointer;
}

.testimonial-dot.active {
    background: #fff;
}

.add-testimonial-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #fff;
    color: #1d4ed8;
    font-weight: 700;
    border: none;
    border-radius: 9999px;
    padding: .8rem 1.2rem;
}

.testimonial-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.testimonial-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.testimonial-modal-content {
    width: min(680px, calc(100% - 24px));
    margin: 4vh auto;
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    position: relative;
    max-height: 92vh;
    overflow: auto;
}

.testimonial-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    border: 0;
    background: #f1f5f9;
    font-size: 1.2rem;
}

.testimonial-form-group {
    margin-bottom: .9rem;
}

.testimonial-form-group label {
    font-weight: 600;
    display: block;
    margin-bottom: .4rem;
}

.testimonial-form-group input,
.testimonial-form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: .65rem;
    padding: .65rem .75rem;
}

.testimonial-form-group textarea {
    min-height: 110px;
}

.rating-selector .star {
    font-size: 1.5rem;
    cursor: pointer;
    color: #cbd5e1;
}

.rating-selector .star.active {
    color: #f59e0b;
}

.submit-testimonial-btn {
    border: 0;
    border-radius: .7rem;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    padding: .75rem 1rem;
    width: 100%;
}

#sponsorshipModal > div {
    position: relative;
}

@media (max-width: 768px) {
    .testimonials-container {
        max-width: none;
        padding: 0 6px;
        overflow-x: clip;
        perspective: 900px;
    }

    .testimonials-wrapper {
        min-height: 400px;
    }

    .testimonial-card {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        padding: .95rem;
        border-radius: 16px;
        min-height: clamp(300px, 58vh, 430px);
    }

    .testimonial-card.stack-next-1 {
        transform: translate3d(0, 15px, -24px) scale(0.97) rotateX(1.8deg) rotateY(-10deg);
    }

    .testimonial-card.stack-next-2 {
        transform: translate3d(0, 28px, -46px) scale(0.94) rotateX(3.2deg) rotateY(-15deg);
    }

    .testimonial-content {
        font-size: .93rem;
        line-height: 1.55;
    }

    .testimonial-info h4 {
        font-size: .95rem;
    }

    .testimonial-info p {
        font-size: .75rem;
    }
}

@media (max-width: 420px) {
    .testimonials-wrapper {
        min-height: 380px;
    }

    .testimonial-card {
        min-height: clamp(280px, 56vh, 380px);
        padding: .85rem;
    }

    .testimonial-content {
        font-size: .9rem;
    }
}

@media (min-width: 1200px) {
    .testimonials-container {
        max-width: 920px;
        perspective: none;
    }

    .testimonials-wrapper.layout-desktop {
        min-height: 390px;
    }
}

@media (min-width: 992px) {
    .testimonials-container {
        max-width: 860px;
        perspective: none;
    }

    .testimonials-wrapper.layout-desktop .testimonial-content {
        font-size: 1rem;
        line-height: 1.65;
    }
}
