/**
 * GazExpress — Motion globale (toutes les pages / rôles)
 * Complète gx-motion.css — appliqué via layouts + gx-app-motion.js
 */

@keyframes gx-page-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gx-scale-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes gx-slide-right {
    from { opacity: 0; transform: translateX(-14px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes gx-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Entrée de page — sans transform (sinon position:fixed cassé sur carte adresse) */
body.gx-ui-v2 main,
body.gx-ui-v2 .gx-public-main,
body.gx-ui-v2 .gx-shell > main,
body.gx-ui-v2 .gx-ash > main {
    animation: gx-page-in 0.45s var(--gx-ease-out) both;
    transform: none !important;
}

/* Éléments auto-révélés au scroll */
.gx-auto-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.55s var(--gx-ease-out),
        transform 0.55s var(--gx-ease-out),
        box-shadow 0.25s var(--gx-ease-out);
}

.gx-auto-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.gx-auto-reveal--scale {
    transform: translateY(12px) scale(0.97);
}

.gx-auto-reveal--scale.is-visible {
    transform: translateY(0) scale(1);
}

.gx-auto-reveal--slide {
    transform: translateX(-16px);
}

.gx-auto-reveal--slide.is-visible {
    transform: translateX(0);
}

/* Stagger enfants visibles */
.gx-auto-reveal.is-visible.gx-auto-stagger {
    transition-delay: calc(var(--gx-stagger, 0) * var(--gx-stagger-step));
}

/* Cartes & blocs interactifs */
.gx-card,
.gx-v2-card,
.gx-v2-stat,
.gx-adash__card,
.gx-akyc__kpi > *,
.gx-cl-card,
.gx-depot-card {
    transition:
        transform 0.22s var(--gx-ease-out),
        box-shadow 0.22s var(--gx-ease-out),
        border-color 0.2s;
}

@media (hover: hover) {
    .gx-card:hover,
    .gx-v2-card:hover,
    .gx-v2-stat:hover,
    .gx-adash__card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    }
}

.gx-card:active,
.gx-v2-card:active,
.gx-v2-cta:active,
.gx-btn:active,
button.gx-v2-cta:active {
    transform: scale(0.98);
}

/* Titres & sections */
.gx-v2-title,
.gx-page-head h1,
.gx-clh__title,
.gx-ash-head__title {
    animation: gx-slide-right 0.5s var(--gx-ease-out) 0.05s both;
}

.gx-v2-section,
.gx-v2-lead {
    animation: gx-fade-up 0.45s var(--gx-ease-out) 0.1s both;
}

/* Listes & tableaux */
table tbody tr {
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background: rgba(29, 78, 216, 0.04);
}

.gx-list-row,
.gx-akyc__row,
.gx-cmenu__row {
    transition: transform 0.18s var(--gx-ease-out), background 0.15s;
}

@media (hover: hover) {
    .gx-cmenu__row:hover,
    .gx-akyc__row:hover {
        transform: translateX(3px);
    }
}

/* Boutons & liens */
a[href]:not(.gx-hub__cta):not(.gx-hub__pcard) {
    transition: color 0.15s, opacity 0.15s;
}

.gx-v2-cta,
.gx-btn,
.gx-hub__bottles-all {
    transition:
        transform 0.15s var(--gx-ease-out),
        box-shadow 0.2s,
        background 0.15s;
}

/* Champs formulaire focus */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gx-primary) 25%, transparent);
}

/* Chercher : pas d’anneau bleu dans le champ (le dock gère le focus) */
.gx-chercher__input:focus,
.gx-chercher__input:focus-visible,
.gx-chercher__field input:focus,
.gx-chercher__field input:focus-visible,
.gx-hub__place-form input:focus,
.gx-hub__place-form input:focus-visible,
.gx-adresse input:focus,
.gx-adresse input:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

/* Badges & pills */
.gx-badge,
.gx-v2-stat__value,
[class*="__badge"] {
    transition: transform 0.2s var(--gx-ease-spring);
}

/* Modales / drawers */
.gx-ash-drawer,
.gx-ash-backdrop {
    transition-duration: var(--gx-duration-sheet);
}

/* Icônes décoratives légères */
.gx-adash__ico,
.gx-v2-stat__icon {
    animation: gx-float 4s ease-in-out infinite;
}

.gx-adash__ico:nth-child(2n),
.gx-v2-stat:nth-child(2n) .gx-v2-stat__icon {
    animation-delay: 0.6s;
}

@media (prefers-reduced-motion: reduce) {
    body.gx-ui-v2 main,
    body.gx-ui-v2 .gx-public-main,
    .gx-auto-reveal,
    .gx-v2-title,
    .gx-v2-section,
    .gx-v2-lead,
    .gx-adash__ico,
    .gx-v2-stat__icon {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
