/* REM Live · « Testez votre connexion » : quatre vérifications, un bilan, des conseils. */

.test-connexion {
    display: grid;
    gap: var(--e-5);
    max-width: 720px;
    margin: 0 auto;
}

.test-connexion [hidden] {
    display: none !important;
}

.test-connexion h1 {
    font-size: var(--t-3xl);
    letter-spacing: -0.03em;
}

.test-connexion__intro {
    max-width: 60ch;
    color: var(--texte-2);
    font-size: var(--t-md);
}

.test-connexion__carte {
    padding: var(--e-2) var(--e-6) var(--e-6);
}

.tests {
    margin: 0;
    padding: 0;
    list-style: none;
}

.test {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: var(--e-4);
    padding: var(--e-5) 0;
    border-bottom: 1px solid var(--bordure);
}

.test h3 {
    font-size: var(--t-md);
    font-weight: 600;
}

.test p {
    margin-top: var(--e-1);
    color: var(--texte-2);
}

/* La pastille d'état : vide en attente, qui tourne pendant la vérification, puis verte, orange ou rouge */
.test__etat {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid var(--bordure);
    border-radius: 50%;
    font-size: var(--t-xs);
    font-weight: 700;
}

.test[data-statut="cours"] .test__etat {
    border-color: var(--bordure);
    border-top-color: var(--couleur, var(--action));
    animation: rl-tourne 0.9s linear infinite;
}

.test[data-statut="ok"] .test__etat {
    border-color: var(--succes);
    background: var(--succes-doux);
    color: var(--succes);
}

.test[data-statut="att"] .test__etat {
    border-color: var(--attention);
    background: var(--attention-doux);
    color: var(--texte);
}

.test[data-statut="ko"] .test__etat {
    border-color: var(--danger);
    background: var(--danger-doux);
    color: var(--danger);
}

.test__mesure {
    color: var(--texte) !important;
    font-size: var(--t-2xl);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.test__son {
    margin-top: var(--e-3);
}

.test-connexion__pied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-4);
    margin-top: var(--e-6);
}

.test-connexion__bilan {
    font-weight: 600;
}

.test-connexion__bilan:empty {
    display: none;
}

.test-connexion__bilan[data-statut="ko"] {
    color: var(--danger);
}

.test-connexion__conseils {
    padding: var(--e-5) var(--e-6);
    border-radius: var(--r-lg);
    background: var(--surface-2);
}

.test-connexion__conseils h2 {
    margin-bottom: var(--e-3);
    font-size: var(--t-lg);
}

.test-connexion__conseils ul {
    display: grid;
    gap: var(--e-2);
    margin: 0;
    padding-left: var(--e-5);
}

.test-connexion__retour a {
    display: inline-flex;
    align-items: center;
    gap: var(--e-2);
    color: var(--texte-2);
}

.test-connexion__retour .icone {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .test[data-statut="cours"] .test__etat {
        animation: none;
        border-color: var(--couleur, var(--action));
    }
}

@media (max-width: 560px) {
    .test-connexion h1 {
        font-size: var(--t-2xl);
    }

    .test-connexion__carte {
        padding: 0 var(--e-4) var(--e-5);
    }

    .test-connexion__conseils {
        padding: var(--e-4);
    }
}

/* La suite, après le test : où aller maintenant (toujours visible, mise en avant une fois le test fini) */
.test-suite {
    display: grid;
    gap: var(--e-3);
    margin-top: var(--e-6);
    padding: var(--e-5);
    border: 1px solid var(--bordure);
    border-radius: var(--r-xl, 24px);
    background: var(--surface);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.5s cubic-bezier(0.25, 1.35, 0.45, 1);
}

.test-suite__titre {
    margin: 0;
    color: var(--texte);
    font-size: var(--t-lg, 18px);
    font-weight: 700;
}

.test-suite__boutons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-3);
}

.test-suite__boutons .icone {
    width: 18px;
    height: 18px;
}

.test-suite.est-pret {
    border-color: var(--couleur, var(--action));
    box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--couleur, var(--action)) 70%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
    .test-suite.est-pret {
        animation: test-suite 0.6s cubic-bezier(0.25, 1.35, 0.45, 1);
    }
}

@keyframes test-suite {
    from { transform: translateY(12px); opacity: 0.6; }
}

@media (max-width: 734px) {
    .test-suite__boutons .bouton {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* Audit du 19/11 : le bouton du test en pilule, en pleine largeur au doigt, et la page ne passe pas sous Rémi IA */
.test-connexion__pied .bouton {
    min-height: 52px;
    padding: 0 26px;
    border-radius: 999px;
    font-weight: 700;
}

@media (max-width: 734px) {
    .test-connexion__pied .bouton {
        width: 100%;
        justify-content: center;
    }

    .test-connexion {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }
}
