/* ============================================================
   auth-tfg.css
   Style partagé pour toutes les pages d'authentification TFG
   Login • Mot de passe oublié • Réinitialisation • etc.
   ============================================================ */


/* ============================================================
   POLICES
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');


/* ============================================================
   RESET GLOBAL
   ============================================================ */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}


/* ============================================================
   PAGE D'AUTHENTIFICATION
   ============================================================ */

.tfg-page {
    position: relative;

    width: 100%;
    min-height: 100vh;

    display: flex;

    /*
     * IMPORTANT :
     * On ne centre plus verticalement avec align-items:center.
     * La carte commence maintenant près du haut de l'écran.
     */
    align-items: flex-start;

    justify-content: center;

    /*
     * Petit espace propre au-dessus.
     */
    padding: 28px 16px 28px;

    margin: 0;

    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    overflow: hidden;

    background: transparent;
}


/* ============================================================
   FOND IMAGE PLEINE PAGE
   ============================================================ */

.tfg-bg {
    position: fixed;

    inset: 0;

    z-index: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background-color: #1e293b;

    background-image: url('../images/backgroundlogin.png');

    background-repeat: no-repeat;

    background-position: center center;

    background-size: cover;
}


/* ============================================================
   POINT "ESPACE SÉCURISÉ"
   ============================================================ */

.tfg-live-dot {
    position: relative;

    display: inline-block;

    width: 8px;
    height: 8px;

    margin-right: 8px;

    border-radius: 999px;

    background: #5d6261;
}


.tfg-live-dot::after {
    content: '';

    position: absolute;

    inset: -5px;

    border-radius: 999px;

    border: 1px solid #687574;

    opacity: 0.55;

    animation:
        tfg-ping
        2.2s cubic-bezier(0, 0, 0.2, 1)
        infinite;
}


@keyframes tfg-ping {

    0% {
        transform: scale(0.6);
        opacity: 0.6;
    }

    75%,
    100% {
        transform: scale(2.3);
        opacity: 0;
    }

}


/* ============================================================
   CARTE PRINCIPALE
   ============================================================ */

.tfg-card {
    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 400px;

    margin: 0 auto;

    background: #ffffff;

    border-radius: 20px;

    overflow: hidden;

    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.12),
        0 4px 14px rgba(0, 0, 0, 0.06);

    animation:
        tfg-card-in
        0.55s
        cubic-bezier(0.16, 1, 0.3, 1);
}


/* ============================================================
   ANIMATION DE LA CARTE
   ============================================================ */

@keyframes tfg-card-in {

    from {
        opacity: 0;

        transform:
            translateY(14px)
            scale(0.985);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


/* ============================================================
   HEADER DE LA CARTE
   ============================================================ */

.tfg-card-header {
    background: linear-gradient(
        135deg,
        #043e75 0%,
        #043e75 100%
    );

    padding: 28px 24px 24px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;
}


/* ============================================================
   LOGO
   ============================================================ */

.tfg-logo-ring {
    width: 96px;
    height: 96px;

    border-radius: 999px;

    padding: 4px;

    background:
        linear-gradient(
            135deg,
            #033b85,
            #0862a2
        );

    box-shadow:
        0 8px 24px rgba(14, 165, 160, 0.25);
}


.tfg-logo-ring img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: 999px;

    border: 3px solid #0F172A;
}


/* ============================================================
   PETIT TITRE "ESPACE SÉCURISÉ"
   ============================================================ */

.tfg-card-eyebrow {
    display: flex;

    align-items: center;

    margin-top: 14px;

    font-family: 'JetBrains Mono', monospace;

    font-size: 0.65rem;

    font-weight: 500;

    letter-spacing: 0.12em;

    text-transform: uppercase;

    color: rgba(255, 255, 255, 0.55);
}


/* ============================================================
   TITRE TFG SARL
   ============================================================ */

.tfg-card-title {
    margin: 2px 0 0;

    font-family: 'Space Grotesk', sans-serif;

    font-size: 1.3rem;

    font-weight: 700;

    line-height: 1.3;

    text-align: center;

    color: #ffffff;
}


/* ============================================================
   CORPS DE LA CARTE
   ============================================================ */

/*
 * IMPORTANT :
 *
 * Avant :
 *
 * padding: 26px 24px 36%;
 *
 * Le 36% créait énormément d'espace vertical.
 *
 * Maintenant :
 *
 * padding: 26px 24px 28px;
 *
 * Cela garde un espace propre et contrôlé.
 */

.tfg-card-body {
    padding: 26px 24px 28px;

    background: #f6f6f6;
}


/* ============================================================
   TITRE DU FORMULAIRE
   ============================================================ */

.tfg-card-body-title {
    margin: 0;

    color: #123b61;

    font-size: 1.3rem;

    font-weight: 700;

    line-height: 1.35;

    text-align: center;
}


/* ============================================================
   DESCRIPTION
   ============================================================ */

.tfg-card-description {
    max-width: 340px;

    margin: 8px auto 20px;

    color: #64748b;

    font-size: 0.83rem;

    line-height: 1.6;

    text-align: center;
}


/* ============================================================
   LABELS
   ============================================================ */

.tfg-field-label {
    display: block;

    margin-bottom: 4px;

    color: #334155;

    font-size: 0.8rem;

    font-weight: 600;
}


/* ============================================================
   CHAMPS INPUT
   ============================================================ */

.tfg-input {
    width: 100%;

    box-sizing: border-box;

    border: 1px solid #E1E7F0;

    border-radius: 10px;

    background: #F8FAFC;

    padding: 9px 14px;

    color: #0F172A;

    font-size: 0.9rem;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}


.tfg-input:hover {
    border-color: #CBD5E1;
}


.tfg-input:focus {
    outline: none;

    border-color: #0EA5A0;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(14, 165, 160, 0.14);
}


/* ============================================================
   CHECKBOX
   ============================================================ */

.tfg-checkbox {
    width: 16px;
    height: 16px;

    margin: 0;

    border-radius: 5px;

    border: 1px solid #CBD5E1;

    color: #0EA5A0;

    accent-color: #0EA5A0;
}


.tfg-checkbox:focus {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(14, 165, 160, 0.14);
}


/* ============================================================
   LIENS
   ============================================================ */

.tfg-link {
    display: inline-block;

    margin-top: 2px;

    color: #0EA5A0;

    font-size: 0.8rem;

    font-weight: 500;

    text-decoration: none;

    white-space: nowrap;
}


.tfg-link:hover {
    color: #0B7C78;

    text-decoration: underline;
}


/* ============================================================
   BOUTON PRINCIPAL
   ============================================================ */

.tfg-btn-primary {
    width: 100%;

    border: none;

    border-radius: 10px;

    padding: 11px 16px;

    cursor: pointer;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #686d6c,
            #818584
        );

    font-size: 0.9rem;

    font-weight: 600;

    box-shadow:
        0 6px 18px rgba(110, 112, 112, 0.25);

    transition:
        filter 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.tfg-btn-primary:hover {
    filter: brightness(1.06);

    transform: translateY(-1px);

    box-shadow:
        0 9px 22px rgba(110, 112, 112, 0.30);
}


.tfg-btn-primary:active {
    transform: translateY(0);
}


/* ============================================================
   BOUTON AFFICHER / MASQUER MOT DE PASSE
   ============================================================ */

.tfg-eye-btn {
    color: #858a91;

    background: none;

    border: none;

    cursor: pointer;

    transition: color 0.15s ease;
}


.tfg-eye-btn:hover {
    color: #334155;
}


/* ============================================================
   ERREURS
   ============================================================ */

.tfg-error {
    margin-top: 4px;

    color: #ef4444;

    font-size: 0.75rem;
}


/* ============================================================
   LIGNE "SE SOUVENIR DE MOI"
   ============================================================ */

.tfg-remember-row {
    display: flex;

    flex-wrap: nowrap;

    align-items: center;

    justify-content: space-between;

    gap: 8px;
}


/* ============================================================
   LABEL CHECKBOX
   ============================================================ */

.tfg-remember-label {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    cursor: pointer;

    white-space: nowrap;

    color: #4a5568;

    font-size: 0.82rem;
}


.tfg-remember-label input[type="checkbox"] {
    margin: 0;

    flex-shrink: 0;
}


/* ============================================================
   RESPONSIVE — TABLETTES / PETITS ÉCRANS
   ============================================================ */

@media (max-width: 768px) {

    .tfg-page {
        padding: 24px 14px 24px;

        align-items: flex-start;
    }

    .tfg-card {
        max-width: 400px;
    }

}


/* ============================================================
   RESPONSIVE — TÉLÉPHONES
   ============================================================ */

@media (max-width: 480px) {

    .tfg-page {
        min-height: 100vh;

        padding:
            18px
            12px
            24px;

        align-items: flex-start;
    }


    .tfg-card {
        width: 100%;

        max-width: 100%;

        border-radius: 18px;
    }


    .tfg-card-header {
        padding:
            22px
            16px
            18px;
    }


    .tfg-logo-ring {
        width: 72px;

        height: 72px;
    }


    .tfg-card-title {
        font-size: 1.1rem;
    }


    .tfg-card-eyebrow {
        font-size: 0.58rem;

        margin-top: 10px;
    }


    .tfg-card-body {
        padding:
            20px
            16px
            24px;
    }


    .tfg-card-body-title {
        font-size: 1.1rem;
    }


    .tfg-card-description {
        font-size: 0.78rem;

        margin-bottom: 18px;
    }


    .tfg-remember-row {
        flex-wrap: wrap;

        justify-content: center;

        gap: 4px;
    }


    .tfg-remember-label {
        font-size: 0.75rem;
    }


    .tfg-link {
        font-size: 0.75rem;
    }


    .tfg-btn-primary {
        font-size: 0.85rem;

        padding:
            10px
            14px;
    }

}


/* ============================================================
   TRÈ PETITS ÉCRANS
   ============================================================ */

@media (max-width: 380px) {

    .tfg-page {
        padding:
            14px
            10px
            20px;
    }


    .tfg-card {
        max-width: 100%;
    }


    .tfg-card-header {
        padding:
            18px
            14px
            16px;
    }


    .tfg-logo-ring {
        width: 66px;

        height: 66px;
    }


    .tfg-card-body {
        padding:
            16px
            12px
            22px;
    }


    .tfg-remember-row {
        flex-direction: column;

        align-items: center;

        gap: 3px;
    }


    .tfg-card-body-title {
        font-size: 1.05rem;
    }

}


/* ============================================================
   GRANDS ÉCRANS
   ============================================================ */

@media (min-height: 900px) and (min-width: 769px) {

    .tfg-page {
        padding-top: 40px;
    }

}


/* ============================================================
   TRÈS GRANDS ÉCRANS
   ============================================================ */

@media (min-height: 1100px) and (min-width: 769px) {

    .tfg-page {
        padding-top: 55px;
    }

}


/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */

.tfg-btn-primary:focus-visible,
.tfg-link:focus-visible,
.tfg-eye-btn:focus-visible,
.tfg-input:focus-visible {
    outline: 2px solid #0EA5A0;

    outline-offset: 2px;
}


/* ============================================================
   RÉDUCTION DES ANIMATIONS
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .tfg-card {
        animation: none;
    }

    .tfg-live-dot::after {
        animation: none;
    }

    .tfg-btn-primary {
        transition: none;
    }

    .tfg-input {
        transition: none;
    }

}