@tailwind base;
@tailwind components;
@tailwind utilities;

:where([class^="ri-"])::before {
    content: "\f3c2";
}

#hero {
    background-image: url("/images/hero.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#hero .hero-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.5); /* 50% */
    z-index: 1;
}

.glass {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out;
}

.trusted-logos > div {
    animation-delay: calc(var(--i) * 100ms);
}

.trusted-logos > div:nth-child(1) { --i: 0; }
.trusted-logos > div:nth-child(2) { --i: 1; }
.trusted-logos > div:nth-child(3) { --i: 2; }
.trusted-logos > div:nth-child(4) { --i: 3; }
.trusted-logos > div:nth-child(5) { --i: 4; }
.trusted-logos > div:nth-child(6) { --i: 5; }

/* ==========  Flash messages ========== */
.flash-message {
    position: fixed;
    top: 80px; /* juste en dessous de ton header */
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    min-width: 300px;
    max-width: 600px;
    padding: 15px 40px 15px 15px;
    font-family: sans-serif;
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: opacity 0.5s ease, transform 0.5s ease;
    animation: fadeSlide 5s ease forwards;
    
    }

.flash-message.success { background-color: #38a169; }
.flash-message.error   { background-color: #e53e3e; }
.flash-message.warning { background-color: #f6ad55; color: #000; }
.flash-message.info    { background-color: #4299e1; }

.flash-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}


/* ========== Animations ========== */
@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero-text h2 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .hero-text p {
        font-size: 1rem;
        line-height: 1.5rem;
    }
}

@media (max-width: 640px) {
    .flash-message {
        width: 90%;
        padding: 10px;
        font-size: 12px;
    }
}
