/* ==========================================================================
   XDIRECTTCHAT — AUTHENTIFICATION & PROFIL
   ========================================================================== */


/* ==========================================================================
   VARIABLES LOCALES
   ========================================================================== */

:root {
    --auth-primary: var(--color-primary, #5b5bd6);
    --auth-primary-dark: var(--color-primary-dark, #4848b8);
    --auth-primary-light: var(--color-primary-light, #eeeeff);

    --auth-background: var(--color-background, #f5f7fb);
    --auth-surface: var(--color-surface, #ffffff);
    --auth-surface-soft: var(--color-surface-soft, #f8f9fc);

    --auth-text: var(--color-text, #172033);
    --auth-text-secondary: var(--color-text-secondary, #667085);
    --auth-text-muted: var(--color-text-muted, #98a2b3);

    --auth-border: var(--color-border, #e4e7ec);
    --auth-border-light: var(--color-border-light, #eef0f3);

    --auth-danger: var(--color-danger, #dc2626);
    --auth-success: var(--color-success, #16a34a);

    --auth-radius: var(--radius, 12px);
    --auth-radius-large: var(--radius-large, 18px);

    --auth-shadow: var(--shadow-small, 0 2px 8px rgba(16, 24, 40, 0.05));
    --auth-shadow-large: var(--shadow, 0 8px 24px rgba(16, 24, 40, 0.07));
}


/* ==========================================================================
   PAGE AUTHENTIFICATION
   ========================================================================== */

.auth-page {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.auth-card {
    width: 100%;
    padding: 32px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-large);
    box-shadow: var(--auth-shadow);
}

.auth-card-register {
    max-width: 620px;
    margin: 0 auto;
}

.auth-header {
    margin-bottom: 28px;
    text-align: center;
}

.auth-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 58px;
    height: 58px;

    margin: 0 auto 16px;

    background: var(--auth-primary-light);
    border-radius: 50%;

    font-size: 25px;
}

.auth-header .page-title {
    margin: 0;
}

.auth-header p {
    margin: 8px 0 0;
    color: var(--auth-text-secondary);
    font-size: 14px;
}


/* ==========================================================================
   FORMULAIRE AUTH
   ========================================================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-form label,
.auth-form .form-label {
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 600;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-label-row a {
    color: var(--auth-primary);
    font-size: 13px;
}

.form-label-row a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-form input,
.auth-form textarea,
.auth-form select {
    width: 100%;
}

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    color: var(--auth-text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.auth-checkbox input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;

    flex: 0 0 auto;
    accent-color: var(--auth-primary);
}

.auth-checkbox a {
    color: var(--auth-primary);
    font-weight: 500;
}

.auth-checkbox a:hover {
    text-decoration: underline;
}


/* ==========================================================================
   ALERTES
   ========================================================================== */

.auth-alert-error,
.auth-alert-success {
    padding: 12px 14px;

    border-radius: var(--auth-radius);

    font-size: 14px;
    line-height: 1.5;
}

.auth-alert-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}


/* ==========================================================================
   FOOTER AUTH
   ========================================================================== */

.auth-footer {
    margin-top: 24px;

    color: var(--auth-text-secondary);
    font-size: 14px;
    text-align: center;
}

.auth-footer a {
    color: var(--auth-primary);
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}


/* ==========================================================================
   PROFIL
   ========================================================================== */

.profil-page {
    width: 100%;
}

.profil-card {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;

    padding: 0;

    overflow: hidden;
}


/* ==========================================================================
   EN-TÊTE DU PROFIL
   ========================================================================== */

.profil-header {
    display: flex;
    align-items: center;
    gap: 20px;

    padding: 28px 30px;

    background:
        linear-gradient(
            135deg,
            var(--auth-surface) 0%,
            var(--auth-surface-soft) 100%
        );

    border-bottom: 1px solid var(--auth-border-light);
}

.profil-avatar {
    width: 120px;
    height: 120px;

    flex: 0 0 120px;

    overflow: hidden;

    background: var(--auth-primary-light);

    border: 3px solid var(--auth-surface);
    border-radius: 50%;

    box-shadow: 0 3px 12px rgba(16, 24, 40, 0.10);
}

.profil-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.profil-identity {
    min-width: 0;
    flex: 1;
}

.profil-identity .page-title {
    overflow: hidden;

    margin: 0;

    font-size: 25px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profil-role {
    display: inline-flex;
    align-items: center;

    margin-top: 7px;
    padding: 4px 10px;

    color: var(--auth-primary-dark);
    background: var(--auth-primary-light);

    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
}

.profil-header-actions {
    flex: 0 0 auto;
}


/* ==========================================================================
   CONTENU DU PROFIL
   ========================================================================== */

.profil-content {
    padding: 30px;
}

.profil-section {
    padding: 0 0 28px;
    margin: 0 0 28px;

    border-bottom: 1px solid var(--auth-border-light);
}

.profil-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;

    border-bottom: 0;
}

.profil-section h2 {
    margin: 0 0 14px;

    color: var(--auth-text);

    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}


/* ==========================================================================
   DESCRIPTION
   ========================================================================== */

.profil-description {
    margin: 0;

    color: var(--auth-text-secondary);

    font-size: 15px;
    line-height: 1.75;

    white-space: normal;
}

.profil-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 16px 18px;

    background: var(--auth-surface-soft);

    border: 1px dashed var(--auth-border);
    border-radius: var(--auth-radius);

    color: var(--auth-text-muted);

    font-size: 14px;
}

.profil-empty a {
    color: var(--auth-primary);
    font-weight: 600;
    white-space: nowrap;
}

.profil-empty a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}


/* ==========================================================================
   INFORMATIONS
   ========================================================================== */

.profil-info-list {
    overflow: hidden;

    background: var(--auth-surface-soft);

    border: 1px solid var(--auth-border-light);
    border-radius: var(--auth-radius);
}

.profil-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 52px;
    padding: 12px 16px;

    border-bottom: 1px solid var(--auth-border-light);

    font-size: 14px;
}

.profil-info-row:last-child {
    border-bottom: 0;
}

.profil-info-row > span {
    color: var(--auth-text-secondary);
}

.profil-info-row > strong {
    color: var(--auth-text);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.profil-info-row > a {
    color: var(--auth-primary);
    font-weight: 600;
    text-align: right;
}

.profil-info-row > a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}


/* ==========================================================================
   LIENS / ESPACE MEMBRE
   ========================================================================== */

.profil-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.profil-link {
    display: flex;
    align-items: center;
    gap: 13px;

    min-width: 0;

    padding: 16px;

    color: var(--auth-text);

    background: var(--auth-surface);

    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);

    box-shadow: var(--auth-shadow);

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.profil-link:hover {
    background: var(--auth-surface-soft);
    border-color: var(--auth-primary);

    box-shadow: var(--auth-shadow-large);

    transform: translateY(-2px);
}

.profil-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    background: var(--auth-primary-light);

    border-radius: 11px;

    font-size: 19px;
}

.profil-link > span:last-child {
    min-width: 0;
}

.profil-link strong {
    display: block;

    overflow: hidden;

    color: var(--auth-text);

    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profil-link small {
    display: block;

    margin-top: 3px;

    overflow: hidden;

    color: var(--auth-text-muted);

    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ==========================================================================
   LIEN DÉCONNEXION
   ========================================================================== */

.profil-link-danger {
    color: var(--auth-danger);
}

.profil-link-danger .profil-link-icon {
    background: #fef2f2;
}

.profil-link-danger strong {
    color: var(--auth-danger);
}

.profil-link-danger:hover {
    border-color: #fecaca;
    background: #fffafa;
}

/* ==========================================================================
   MODIFICATION DU PROFIL
   ========================================================================== */

.profil-modifier-page {
    width: 100%;
}

.profil-modifier-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}


/* ==========================================================================
   EN-TÊTE
   ========================================================================== */

.profil-modifier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 28px 30px;

    background: var(--auth-surface-soft);

    border-bottom: 1px solid var(--auth-border-light);
}

.profil-modifier-header .page-title {
    margin: 0;
}

.profil-modifier-header .page-subtitle {
    margin: 7px 0 0;
}


/* ==========================================================================
   ALERTES
   ========================================================================== */

.profil-alert {
    margin: 24px 30px 0;
}


/* ==========================================================================
   FORMULAIRE
   ========================================================================== */

.profil-edit-form {
    width: 100%;
}

.profil-edit-section {
    padding: 30px;

    border-bottom: 1px solid var(--auth-border-light);
}

.profil-edit-section:last-of-type {
    border-bottom: 0;
}

.profil-edit-section-header {
    margin-bottom: 22px;
}

.profil-edit-section-header h2 {
    margin: 0;

    color: var(--auth-text);

    font-size: 18px;
    font-weight: 700;
}

.profil-edit-section-header p {
    margin: 6px 0 0;

    color: var(--auth-text-secondary);

    font-size: 14px;
}


/* ==========================================================================
   AVATAR
   ========================================================================== */

.profil-avatar-editor {
    display: flex;
    align-items: center;
    gap: 22px;
}

.profil-avatar-edit {
    width: 110px;
    height: 110px;

    flex: 0 0 110px;
}

.profil-avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.profil-file-input {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    border: 0;

    clip: rect(0, 0, 0, 0);
}

.profil-form-help {
    color: var(--auth-text-muted);

    font-size: 12px;
    line-height: 1.5;
}


/* ==========================================================================
   CHAMPS
   ========================================================================== */

.profil-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.profil-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.profil-form-group label {
    color: var(--auth-text);

    font-size: 14px;
    font-weight: 600;
}

.profil-form-group textarea {
    min-height: 130px;
    resize: vertical;
}

.profil-form-group-spaced {
    margin-top: 18px;
}


/* ==========================================================================
   ACTIONS
   ========================================================================== */

.profil-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;

    padding: 24px 30px;

    background: var(--auth-surface-soft);

    border-top: 1px solid var(--auth-border-light);
}


/* ==========================================================================
   HOVER / FOCUS
   ========================================================================== */

.profil-form-group input:hover,
.profil-form-group textarea:hover,
.profil-form-group select:hover {
    border-color: #d0d5dd;
}

.profil-form-group input:focus,
.profil-form-group textarea:focus,
.profil-form-group select:focus {
    border-color: var(--auth-primary);
}

/* =========================================================
   LIKES PROFIL
   ========================================================= */

.profil-likes-count {
    margin-top: 8px;
    color: #777;
    font-size: 14px;
}

.profil-likes-count strong {
    color: #d6455d;
    font-size: 15px;
}


/* Bouton */

.profil-like-form {
    margin-left: auto;
}

.profil-like-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 9px;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.profil-like-button:hover {
    background: #fff5f6;
    border-color: #f0b8c0;
}

.profil-like-button.liked {
    background: #fff1f3;
    border-color: #f2b2bc;
    color: #d6455d;
}

.profil-like-icon {
    font-size: 19px;
    line-height: 1;
}

.profil-friend-form {
    margin: 0;
}

.profil-friend-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: #f1f3f5;
    color: #333;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: 0.2s ease;
}

.profil-friend-button:hover {
    background: #e2e6ea;
    transform: translateY(-1px);
}

.profil-friend-button .profil-link-icon {
    font-size: 22px;
}

.profil-friend-button strong {
    display: block;
    margin-bottom: 3px;
}

.profil-friend-button small {
    display: block;
    color: #777;
    font-size: 12px;
}

.profil-friend-status {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f1f3f5;
    color: #777;
    font-size: 14px;
}

.profil-friend-status.amis {
    background: #e8f7ed;
    color: #247a42;
    font-weight: 600;
}


/* Mobile */

/* ==========================================================================
   RESPONSIVE — TABLETTE
   ========================================================================== */

@media (max-width: 760px) {

    .profil-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .profil-identity {
        padding-top: 5px;
    }

    .profil-header-actions {
        width: 100%;
        margin-top: 5px;
    }

    .profil-header-actions .bouton {
        width: 100%;
    }

    .profil-links {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   TABLETTE
   ========================================================================== */

@media (max-width: 700px) {

    .profil-modifier-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .profil-modifier-header .bouton {
        width: 100%;
    }

    .profil-form-grid {
        grid-template-columns: 1fr;
    }
	
    .profil-header {
        flex-wrap: wrap;
    }

    .profil-like-form {
        width: 100%;
        margin-left: 0;
    }

    .profil-like-button {
        width: 100%;
        justify-content: center;
    }	
	
}


/* ==========================================================================
   RESPONSIVE — MOBILE
   ========================================================================== */

@media (max-width: 560px) {

    .profil-card {
        border-radius: var(--auth-radius);
    }

    .profil-header {
        display: grid;
        grid-template-columns: auto 1fr;

        gap: 14px;

        padding: 22px 18px;
    }

    .profil-identity .page-title {
        font-size: 21px;
    }

    .profil-header-actions {
        grid-column: 1 / -1;
        margin-top: 3px;
    }

    .profil-content {
        padding: 22px 18px;
    }

    .profil-section {
        padding-bottom: 22px;
        margin-bottom: 22px;
    }

    .profil-section h2 {
        font-size: 17px;
    }

    .profil-info-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .profil-info-row > strong,
    .profil-info-row > a {
        text-align: left;
    }

    .profil-empty {
        align-items: flex-start;
        flex-direction: column;
    }

    .profil-empty a {
        white-space: normal;
    }
	
    .profil-modifier-header {
        padding: 22px 18px;
    }

    .profil-edit-section {
        padding: 22px 18px;
    }

    .profil-alert {
        margin: 18px 18px 0;
    }

    .profil-avatar-editor {
        align-items: flex-start;
        flex-direction: column;
    }

    .profil-avatar-edit {
        width: 95px;
        height: 95px;
        flex-basis: 95px;
    }

    .profil-avatar-upload {
        width: 100%;
    }

    .profil-avatar-upload label {
        width: 100%;
        justify-content: center;
    }

    .profil-edit-actions {
        align-items: stretch;
        flex-direction: column-reverse;

        padding: 20px 18px;
    }

    .profil-edit-actions .bouton {
        width: 100%;
        justify-content: center;
    }	
}


/* ==========================================================================
   PETIT MOBILE
   ========================================================================== */

@media (max-width: 400px) {

    .profil-header {
        padding: 20px 15px;
    }

    .profil-content {
        padding: 20px 15px;
    }

    .profil-identity .page-title {
        font-size: 19px;
    }

    .profil-role {
        font-size: 11px;
    }

    .profil-link {
        padding: 14px;
    }
}

    .auth-required {
        max-width: 600px;
        margin: 60px auto;
        padding: 40px 25px;
        text-align: center;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    }

    .auth-required-icon {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .auth-required h2 {
        margin: 0 0 10px;
        font-size: 26px;
    }

    .auth-required p {
        margin: 0 0 25px;
        color: #666;
    }

    .auth-required-buttons {
        display: flex;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .auth-required-buttons .bouton {
        text-decoration: none;
    }
	

        .auth-banned {
            max-width: 620px;
            margin: 60px auto;
            padding: 45px 30px;
            text-align: center;
            background: #ffffff;
            border-radius: 20px;
            box-shadow: 0 8px 35px rgba(0, 0, 0, 0.10);
            border: 1px solid #fee2e2;
        }

        .auth-banned-icon {
            width: 76px;
            height: 76px;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #fef2f2;
            border-radius: 50%;
            font-size: 38px;
        }

        .auth-banned h2 {
            margin: 0 0 12px;
            color: #b91c1c;
            font-size: 28px;
        }

        .auth-banned-message {
            margin: 0 0 25px;
            color: #555;
            font-size: 16px;
        }

        .auth-banned-box {
            margin: 25px 0;
            padding: 18px;
            background: #fef2f2;
            border: 1px solid #fecaca;
            border-radius: 14px;
            text-align: left;
        }

        .auth-banned-row {
            display: flex;
            gap: 15px;
            padding: 10px 0;
        }

        .auth-banned-row + .auth-banned-row {
            border-top: 1px solid #fecaca;
        }

        .auth-banned-label {
            min-width: 90px;
            font-weight: 700;
            color: #991b1b;
        }

        .auth-banned-value {
            flex: 1;
            color: #444;
            word-break: break-word;
        }

        .auth-banned-info {
            margin: 20px 0;
            color: #777;
            font-size: 14px;
        }

        .auth-banned-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 11px 20px;
            border-radius: 10px;
            background: #dc2626;
            color: #fff;
            text-decoration: none;
            font-weight: 600;
            transition: 0.2s ease;
        }

        .auth-banned-button:hover {
            background: #b91c1c;
        }

        @media (max-width: 600px) {

            .auth-banned {
                margin: 30px 15px;
                padding: 35px 20px;
            }

            .auth-banned-row {
                flex-direction: column;
                gap: 4px;
            }

            .auth-banned-label {
                min-width: auto;
            }

        }
		
/* =========================================================
   BOUTONS CHOIX INSCRIPTION
========================================================= */

.auth-register-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}


/* Bouton commun */

.auth-register-btn {
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border: none;
    border-radius: 10px;

    font-size: 15px;
    font-weight: 600;
    font-family: inherit;

    text-decoration: none;
    cursor: pointer;

    box-sizing: border-box;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}


/* Effet commun */

.auth-register-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.auth-register-btn:active {
    transform: translateY(0);
}


/* Inscription e-mail */

.auth-register-email {
    background: #1877f2;
    color: #ffffff;
}

.auth-register-email:hover {
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.25);
}


/* Inscription IA-Nude */

.auth-register-ianude {
    background: #222222;
    color: #ffffff;
}

.auth-register-ianude:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}


/* Logo IA-Nude */

.auth-register-ianude img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

/* =========================================================
   CHOIX INSCRIPTION / CONNEXION
========================================================= */

.auth-register-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}


/* Boutons communs */

.auth-register-btn {
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    border: none;
    border-radius: 10px;

    font-size: 15px;
    font-weight: 600;
    font-family: inherit;

    text-decoration: none;
    cursor: pointer;

    box-sizing: border-box;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}


/* Masquer proprement un bouton */

.auth-register-btn.is-hidden {
    display: none !important;
}


/* Bouton e-mail */

.auth-register-email {
    background: #1877f2;
    color: #ffffff;
}

.auth-register-email:hover {
    transform: translateY(-1px);
    opacity: 0.95;
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.25);
}


/* Bouton IA-Nude */

.auth-register-ianude {
    background: #222222;
    color: #ffffff;
}

.auth-register-ianude:hover {
    transform: translateY(-1px);
    opacity: 0.95;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}


/* Image IA-Nude */

.auth-register-ianude img {
    width: 26px;
    height: 26px;

    display: block;

    object-fit: contain;
    object-position: center;

    flex: 0 0 26px;
}		
