/* ============================================================
   JEU DE DAMES
   assets/css/auth.css
   Styles authentification
   ============================================================ */

/* ============================================================
   VARIABLES
   ============================================================ */

:root {
    --auth-primary: #0d6efd;
    --auth-primary-dark: #084298;
    --auth-success: #198754;
    --auth-danger: #dc3545;
    --auth-warning: #ffc107;
    --auth-dark: #111827;
    --auth-text: #1f2937;
    --auth-muted: #6b7280;
    --auth-border: #d1d5db;
    --auth-bg: #f4f7fb;
    --auth-white: #ffffff;

    --auth-radius: 14px;

    --auth-shadow:
        0 15px 45px rgba(0, 0, 0, 0.10);

    --auth-transition:
        all 0.25s ease;
}


/* ============================================================
   RESET
   ============================================================ */

html,
body {
    min-height: 100%;
}

body.auth-body {
    margin: 0;
    padding: 0;

    background: var(--auth-bg);

    color: var(--auth-text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* ============================================================
   CONTENEUR PRINCIPAL
   ============================================================ */

.auth-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px 15px;

    position: relative;

    overflow: hidden;
}


/* ============================================================
   ARRIÈRE-PLAN
   ============================================================ */

.auth-background {
    position: fixed;

    inset: 0;

    z-index: -2;

    background:
        linear-gradient(
            135deg,
            #eef4ff 0%,
            #f8fafc 50%,
            #eaf7f1 100%
        );
}

.auth-background::before,
.auth-background::after {
    content: "";

    position: absolute;

    border-radius: 50%;

    filter: blur(2px);
}

.auth-background::before {
    width: 420px;
    height: 420px;

    top: -180px;
    left: -150px;

    background:
        rgba(13, 110, 253, 0.10);
}

.auth-background::after {
    width: 350px;
    height: 350px;

    right: -120px;
    bottom: -150px;

    background:
        rgba(25, 135, 84, 0.10);
}


/* ============================================================
   CARTE AUTHENTIFICATION
   ============================================================ */

.auth-card {
    width: 100%;

    max-width: 460px;

    background:
        var(--auth-white);

    border:
        1px solid rgba(0, 0, 0, 0.06);

    border-radius:
        var(--auth-radius);

    box-shadow:
        var(--auth-shadow);

    overflow: hidden;

    animation:
        auth-card-in 0.45s ease;
}

@keyframes auth-card-in {

    from {
        opacity: 0;

        transform:
            translateY(15px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}


/* ============================================================
   HEADER
   ============================================================ */

.auth-header {
    padding:
        30px 30px 20px;

    text-align: center;
}

.auth-logo {
    width: 62px;
    height: 62px;

    margin:
        0 auto 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background:
        var(--auth-primary);

    color: #ffffff;

    font-size: 28px;

    box-shadow:
        0 8px 20px
        rgba(13, 110, 253, 0.22);
}

.auth-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    border-radius: inherit;
}

.auth-title {
    margin: 0;

    color: var(--auth-dark);

    font-size: 25px;

    font-weight: 800;

    line-height: 1.25;
}

.auth-subtitle {
    margin:
        8px 0 0;

    color: var(--auth-muted);

    font-size: 14px;

    line-height: 1.5;
}


/* ============================================================
   CORPS
   ============================================================ */

.auth-body-content {
    padding:
        10px 30px 30px;
}


/* ============================================================
   FORMULAIRE
   ============================================================ */

.auth-form-group {
    margin-bottom: 18px;
}

.auth-label {
    display: block;

    margin-bottom: 7px;

    color: #374151;

    font-size: 13px;

    font-weight: 600;
}

.auth-label-required::after {
    content: " *";

    color: var(--auth-danger);
}


/* ============================================================
   INPUT
   ============================================================ */

.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;

    min-height: 46px;

    padding:
        10px 13px;

    background: #ffffff;

    border:
        1px solid var(--auth-border);

    border-radius: 9px;

    color: var(--auth-text);

    font-size: 14px;

    outline: none;

    transition:
        var(--auth-transition);

    box-sizing: border-box;
}

.auth-input:focus {
    border-color:
        var(--auth-primary);

    box-shadow:
        0 0 0 3px
        rgba(13, 110, 253, 0.12);
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input.is-invalid {
    border-color:
        var(--auth-danger);
}

.auth-input.is-valid {
    border-color:
        var(--auth-success);
}


/* ============================================================
   INPUT AVEC ICÔNE
   ============================================================ */

.auth-input-icon {
    position: absolute;

    left: 14px;
    top: 50%;

    transform:
        translateY(-50%);

    color: #9ca3af;

    pointer-events: none;
}

.auth-input.has-icon {
    padding-left: 42px;
}


/* ============================================================
   MOT DE PASSE
   ============================================================ */

.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .auth-input {
    padding-right: 48px;
}

.auth-password-toggle {
    position: absolute;

    top: 50%;
    right: 10px;

    width: 34px;
    height: 34px;

    transform:
        translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    background: transparent;

    color: #6b7280;

    border-radius: 7px;

    cursor: pointer;

    transition:
        var(--auth-transition);
}

.auth-password-toggle:hover {
    background: #f3f4f6;

    color: var(--auth-dark);
}


/* ============================================================
   AIDE FORMULAIRE
   ============================================================ */

.auth-help {
    display: block;

    margin-top: 5px;

    color: var(--auth-muted);

    font-size: 12px;

    line-height: 1.4;
}

.auth-error {
    display: block;

    margin-top: 5px;

    color: var(--auth-danger);

    font-size: 12px;
}

.auth-success {
    display: block;

    margin-top: 5px;

    color: var(--auth-success);

    font-size: 12px;
}


/* ============================================================
   FORCE MOT DE PASSE
   ============================================================ */

.auth-password-strength {
    margin-top: 8px;
}

.auth-password-strength-bar {
    width: 100%;
    height: 5px;

    overflow: hidden;

    background: #e5e7eb;

    border-radius: 50px;
}

.auth-password-strength-progress {
    height: 100%;

    width: 0;

    border-radius: 50px;

    transition:
        width 0.25s ease;
}

.auth-password-strength-text {
    display: block;

    margin-top: 5px;

    font-size: 11px;

    color: var(--auth-muted);
}


/* ============================================================
   OPTIONS
   ============================================================ */

.auth-options {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 20px;

    font-size: 13px;
}

.auth-remember {
    display: flex;

    align-items: center;

    gap: 7px;

    color: #4b5563;
}

.auth-remember input {
    width: 16px;
    height: 16px;

    accent-color:
        var(--auth-primary);
}

.auth-forgot {
    color:
        var(--auth-primary);

    font-weight: 600;
}

.auth-forgot:hover {
    color:
        var(--auth-primary-dark);

    text-decoration: underline;
}


/* ============================================================
   BOUTONS
   ============================================================ */

.auth-button {
    width: 100%;

    min-height: 46px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding:
        10px 16px;

    border: 0;

    border-radius: 9px;

    background:
        var(--auth-primary);

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    transition:
        var(--auth-transition);
}

.auth-button:hover {
    background:
        var(--auth-primary-dark);

    transform:
        translateY(-1px);

    box-shadow:
        0 6px 16px
        rgba(13, 110, 253, 0.20);
}

.auth-button:active {
    transform:
        translateY(0);
}

.auth-button:disabled {
    opacity: 0.65;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* ============================================================
   BOUTONS SECONDAIRES
   ============================================================ */

.auth-button-secondary {
    background:
        #f3f4f6;

    color:
        #374151;
}

.auth-button-secondary:hover {
    background:
        #e5e7eb;

    color:
        #111827;

    box-shadow: none;
}

.auth-button-success {
    background:
        var(--auth-success);
}

.auth-button-success:hover {
    background:
        #146c43;
}

.auth-button-danger {
    background:
        var(--auth-danger);
}

.auth-button-danger:hover {
    background:
        #b02a37;
}


/* ============================================================
   SÉPARATEUR
   ============================================================ */

.auth-divider {
    position: relative;

    display: flex;

    align-items: center;

    margin:
        22px 0;

    color:
        #9ca3af;

    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background:
        #e5e7eb;
}

.auth-divider span {
    padding:
        0 12px;
}


/* ============================================================
   CONNEXION SOCIALE
   ============================================================ */

.auth-social-buttons {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 10px;
}

.auth-social-button {
    min-height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    border:
        1px solid var(--auth-border);

    border-radius: 8px;

    background: #ffffff;

    color: #374151;

    font-size: 13px;

    font-weight: 600;

    transition:
        var(--auth-transition);
}

.auth-social-button:hover {
    background:
        #f8fafc;

    border-color:
        #9ca3af;
}


/* ============================================================
   ALERTES
   ============================================================ */

.auth-alert {
    display: flex;

    align-items: flex-start;

    gap: 9px;

    padding:
        12px 14px;

    margin-bottom: 18px;

    border-radius: 9px;

    border:
        1px solid transparent;

    font-size: 13px;

    line-height: 1.5;
}

.auth-alert-success {
    background:
        #d1e7dd;

    border-color:
        #badbcc;

    color:
        #0f5132;
}

.auth-alert-danger {
    background:
        #f8d7da;

    border-color:
        #f5c2c7;

    color:
        #842029;
}

.auth-alert-warning {
    background:
        #fff3cd;

    border-color:
        #ffecb5;

    color:
        #664d03;
}

.auth-alert-info {
    background:
        #cff4fc;

    border-color:
        #b6effb;

    color:
        #055160;
}


/* ============================================================
   LIENS
   ============================================================ */

.auth-link {
    color:
        var(--auth-primary);

    font-weight: 600;

    text-decoration: none;

    transition:
        var(--auth-transition);
}

.auth-link:hover {
    color:
        var(--auth-primary-dark);

    text-decoration: underline;
}


/* ============================================================
   INSCRIPTION
   ============================================================ */

.auth-register-link {
    margin-top: 20px;

    text-align: center;

    color:
        var(--auth-muted);

    font-size: 13px;
}

.auth-register-link a {
    color:
        var(--auth-primary);

    font-weight: 700;
}


/* ============================================================
   CONDITIONS
   ============================================================ */

.auth-terms {
    display: flex;

    align-items: flex-start;

    gap: 8px;

    margin:
        15px 0 20px;

    color:
        var(--auth-muted);

    font-size: 12px;

    line-height: 1.5;
}

.auth-terms input {
    width: 16px;
    height: 16px;

    flex: 0 0 16px;

    margin-top: 2px;

    accent-color:
        var(--auth-primary);
}


/* ============================================================
   VÉRIFICATION CODE
   ============================================================ */

.auth-code-inputs {
    display: flex;

    justify-content: center;

    gap: 8px;

    margin:
        20px 0;
}

.auth-code-input {
    width: 48px;
    height: 55px;

    text-align: center;

    font-size: 22px;

    font-weight: 700;

    border:
        1px solid var(--auth-border);

    border-radius: 9px;

    outline: none;

    transition:
        var(--auth-transition);
}

.auth-code-input:focus {
    border-color:
        var(--auth-primary);

    box-shadow:
        0 0 0 3px
        rgba(13, 110, 253, 0.12);
}


/* ============================================================
   COMPTE VÉRIFIÉ
   ============================================================ */

.auth-verification-icon {
    width: 72px;
    height: 72px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin:
        0 auto 18px;

    border-radius: 50%;

    background:
        #d1e7dd;

    color:
        var(--auth-success);

    font-size: 32px;
}


/* ============================================================
   FOOTER AUTH
   ============================================================ */

.auth-footer {
    padding:
        18px 30px 25px;

    text-align: center;

    color:
        var(--auth-muted);

    font-size: 12px;

    border-top:
        1px solid #f0f0f0;
}

.auth-footer-links {
    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap: 15px;

    margin-top: 7px;
}


/* ============================================================
   LOGO TEXTE
   ============================================================ */

.auth-brand {
    display: inline-flex;

    align-items: center;

    gap: 9px;

    color:
        var(--auth-dark);

    font-weight: 800;

    font-size: 19px;
}

.auth-brand:hover {
    color:
        var(--auth-dark);
}

.auth-brand-icon {
    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        var(--auth-primary);

    color:
        #ffffff;
}


/* ============================================================
   ÉCHEC / SUCCÈS
   ============================================================ */

.auth-status {
    padding:
        20px;

    text-align: center;

    border-radius: 10px;
}

.auth-status-success {
    background:
        #f0faf5;

    color:
        #0f5132;
}

.auth-status-error {
    background:
        #fff5f5;

    color:
        #842029;
}


/* ============================================================
   LOADING
   ============================================================ */

.auth-loading {
    position: relative;
}

.auth-spinner {
    width: 17px;
    height: 17px;

    display: inline-block;

    border:
        2px solid
        rgba(255, 255, 255, 0.4);

    border-top-color:
        #ffffff;

    border-radius: 50%;

    animation:
        auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {

    to {
        transform:
            rotate(360deg);
    }

}


/* ============================================================
   LOADER PAGE
   ============================================================ */

.auth-page-loader {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        rgba(255, 255, 255, 0.92);

    backdrop-filter:
        blur(4px);
}

.auth-page-loader-spinner {
    width: 42px;
    height: 42px;

    border:
        4px solid #e5e7eb;

    border-top-color:
        var(--auth-primary);

    border-radius: 50%;

    animation:
        auth-spin 0.7s linear infinite;
}


/* ============================================================
   MODE SOMBRE
   ============================================================ */

body.auth-dark {
    --auth-bg: #0f172a;

    --auth-white: #111827;

    --auth-text: #f3f4f6;

    --auth-muted: #9ca3af;

    --auth-border: #374151;

    --auth-dark: #ffffff;
}

body.auth-dark .auth-card {
    border-color:
        #374151;

    box-shadow:
        0 20px 50px
        rgba(0, 0, 0, 0.35);
}

body.auth-dark .auth-input {
    background:
        #1f2937;

    color:
        #f3f4f6;

    border-color:
        #4b5563;
}

body.auth-dark .auth-input::placeholder {
    color:
        #9ca3af;
}

body.auth-dark .auth-background {
    background:
        linear-gradient(
            135deg,
            #111827,
            #0f172a,
            #10231b
        );
}

body.auth-dark .auth-footer {
    border-top-color:
        #374151;
}

body.auth-dark .auth-social-button {
    background:
        #1f2937;

    color:
        #f3f4f6;

    border-color:
        #4b5563;
}


/* ============================================================
   RESPONSIVE TABLETTE
   ============================================================ */

@media (
    max-width: 767.98px
) {

    .auth-page {
        padding:
            20px 12px;
    }

    .auth-card {
        max-width:
            440px;
    }

    .auth-header {
        padding:
            25px 22px 15px;
    }

    .auth-body-content {
        padding:
            10px 22px 25px;
    }

    .auth-footer {
        padding:
            16px 22px 22px;
    }

}


/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */

@media (
    max-width: 575.98px
) {

    .auth-page {
        align-items:
            flex-start;

        padding:
            15px 10px;
    }

    .auth-card {
        margin-top:
            10px;

        border-radius:
            11px;
    }

    .auth-header {
        padding:
            22px 18px 12px;
    }

    .auth-body-content {
        padding:
            10px 18px 22px;
    }

    .auth-title {
        font-size:
            22px;
    }

    .auth-subtitle {
        font-size:
            13px;
    }

    .auth-logo {
        width: 54px;
        height: 54px;

        font-size: 24px;

        border-radius:
            14px;
    }

    .auth-options {
        align-items:
            flex-start;

        flex-direction:
            column;
    }

    .auth-social-buttons {
        grid-template-columns:
            1fr;
    }

    .auth-code-inputs {
        gap: 6px;
    }

    .auth-code-input {
        width: 42px;
        height: 50px;

        font-size: 20px;
    }

}


/* ============================================================
   TRÈS PETITS ÉCRANS
   ============================================================ */

@media (
    max-width: 360px
) {

    .auth-code-input {
        width: 37px;
        height: 45px;

        font-size: 18px;
    }

    .auth-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .auth-body-content {
        padding-left: 14px;
        padding-right: 14px;
    }

}


/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */

.auth-body a:focus-visible,
.auth-body button:focus-visible,
.auth-body input:focus-visible,
.auth-body select:focus-visible,
.auth-body textarea:focus-visible {
    outline:
        3px solid
        rgba(13, 110, 253, 0.30);

    outline-offset: 2px;
}


/* ============================================================
   IMPRESSION
   ============================================================ */

@media print {

    .auth-background {
        display: none;
    }

    .auth-page {
        min-height: auto;
    }

    .auth-card {
        box-shadow: none;

        border:
            1px solid #ddd;
    }

}


/* ============================================================
   FIN auth.css
   ============================================================ */