/*
 * Bouton « verre dépoli » — feuille PARTAGÉE.
 *
 * Ce bouton est utilisé à trois endroits :
 *   - le slider du hero (injecté par js/pages/front/hero-slider.js)
 *   - le bloc « Don rapide » de l'accueil
 *   - les cartes de la page /donations
 *
 * Il vivait dans css/pages/front/home.css, qui n'est chargé que sur l'accueil.
 * Sorti ici et chargé globalement, il n'existe qu'en UN exemplaire : modifier
 * le bouton du hero met à jour les trois d'un coup.
 *
 * Structure et effets repris du modèle fourni (carte en verre dépoli, reflet
 * qui balaie au survol, lueur diffuse, pastille d'icône, deux lignes de texte,
 * chevron qui avance). Deux adaptations volontaires :
 *   - balise <a> dans le hero (il navigue), <button> ailleurs ;
 *   - indigo remplacé par l'orange de la marque, le bouton étant posé sur des
 *     fonds bleu nuit où l'indigo se serait fondu.
 *
 * Écrit en CSS et non en classes Tailwind : ce balisage est en partie injecté
 * par JavaScript, or une classe Tailwind absente du build passe silencieusement
 * à la trappe.
 */

.hero-btn {
    position: relative;
    display: block;
    max-width: 25rem;
    padding: 16px;
    overflow: hidden;
    isolation: isolate;

    border: 2px solid rgba(167, 243, 208, 0.35);
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(9, 122, 73, 0.96) 0%,
            rgba(5, 92, 55, 0.95) 52%,
            rgba(2, 48, 29, 0.98) 100%
        );

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    box-shadow:
        0 18px 40px -14px rgba(3, 70, 42, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);

    text-decoration: none;
    cursor: pointer;

    transition:
        transform 0.5s cubic-bezier(0.22, 0.8, 0.3, 1),
        box-shadow 0.5s ease,
        border-color 0.5s ease;
}

.hero-btn:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(167, 243, 208, 0.75);

    box-shadow:
        0 25px 50px -12px rgba(9, 122, 73, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    text-decoration: none;
}

.hero-btn:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

.hero-btn:focus-visible {
    outline: 3px solid rgba(167, 243, 208, 0.9);
    outline-offset: 3px;
}

/* Reflet animé */
.hero-btn-sheen {
    position: absolute;
    inset: 0;
    z-index: 1;

    background: linear-gradient(
        to right,
        transparent,
        rgba(220, 252, 231, 0.34),
        transparent
    );

    transform: translateX(-100%);
    transition: transform 1s ease-out;
    pointer-events: none;
}

.hero-btn:hover .hero-btn-sheen {
    transform: translateX(100%);
}

/* Lueur verte diffuse */
.hero-btn-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 14px;

    background: linear-gradient(
        to right,
        rgba(52, 211, 153, 0.08),
        rgba(110, 231, 183, 0.25),
        rgba(52, 211, 153, 0.08)
    );

    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.hero-btn:hover .hero-btn-glow {
    opacity: 1;
}

/* Contenu */
.hero-btn-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Pastille de l’icône */
.hero-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;
    flex-shrink: 0;

    border: 1px solid rgba(209, 250, 229, 0.18);
    border-radius: 10px;

    background: linear-gradient(
        135deg,
        rgba(209, 250, 229, 0.22),
        rgba(52, 211, 153, 0.12)
    );

    color: #d1fae5;
    font-size: 1.35rem;

    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        color 0.3s ease;
}

.hero-btn:hover .hero-btn-icon {
    transform: scale(1.1);

    background: linear-gradient(
        135deg,
        rgba(209, 250, 229, 0.34),
        rgba(52, 211, 153, 0.22)
    );

    color: #ffffff;
}

.hero-btn-body {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.hero-btn-title {
    display: block;
    color: #ecfdf5;
    font-size: 1.075rem;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.hero-btn:hover .hero-btn-title {
    color: #ffffff;
}

.hero-btn-sub {
    display: block;
    margin-top: 2px;
    color: #b7e4ce;
    font-size: 0.855rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.hero-btn:hover .hero-btn-sub {
    color: #d1fae5;
}

.hero-btn-arrow {
    display: flex;
    align-items: center;
    flex-shrink: 0;

    color: #a7f3d0;
    opacity: 0.7;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.hero-btn-arrow svg {
    width: 20px;
    height: 20px;
}

.hero-btn:hover .hero-btn-arrow {
    opacity: 1;
    transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
    .hero-btn,
    .hero-btn-sheen,
    .hero-btn-glow,
    .hero-btn-icon,
    .hero-btn-arrow {
        transition: none;
    }

    .hero-btn:hover {
        transform: none;
    }
}
