:root {
    --account-primary: #4F46E5;
    --account-primary-dark: #3730A3;
    --company-accent: #7C3AED;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #dbe3f0;
    --auth-bg: #f8fafc;
    --auth-card: rgba(255, 255, 255, 0.97);
    --auth-shadow:
        0 28px 70px rgba(30, 41, 59, 0.14),
        0 4px 16px rgba(30, 41, 59, 0.05);
    --auth-radius-xl: 30px;
    --auth-radius-lg: 22px;
    --auth-radius-md: 16px;
}

html {
    width: 100%;
    min-width: 0;
}

body.auth-page,
body.auth-page *,
body.auth-page *::before,
body.auth-page *::after {
    box-sizing: border-box;
}

body.auth-page {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--auth-text);
    background:
        radial-gradient(
            circle at 80% 10%,
            rgba(124, 58, 237, 0.12),
            transparent 25rem
        ),
        radial-gradient(
            circle at 85% 90%,
            rgba(79, 70, 229, 0.10),
            transparent 30rem
        ),
        #f6f8fc;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.auth-page img,
body.auth-page svg {
    max-width: 100%;
}

.material-symbols-rounded {
    font-size: 22px;
    line-height: 1;
    vertical-align: middle;
}

.auth-shell {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns:
        minmax(0, 1.08fr)
        minmax(430px, 0.92fr);
    overflow: hidden;
}

/* =========================================================
   PANNEAU VISUEL DESKTOP
========================================================= */

.auth-visual-panel {
    position: relative;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    padding: clamp(30px, 3vw, 54px);
    color: #fff;
    isolation: isolate;
    background:
        linear-gradient(
            145deg,
            rgba(49, 55, 214, 0.98) 0%,
            rgba(71, 60, 214, 0.98) 45%,
            rgba(67, 48, 170, 0.99) 100%
        );
}

.auth-visual-panel::before,
.auth-visual-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.auth-visual-panel::before {
    width: min(46vw, 680px);
    aspect-ratio: 1;
    top: -36%;
    left: -18%;
    background:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.16) 0%,
            rgba(255, 255, 255, 0) 68%
        );
}

.auth-visual-panel::after {
    width: min(38vw, 560px);
    aspect-ratio: 1;
    right: -20%;
    bottom: -30%;
    background:
        radial-gradient(
            circle,
            rgba(167, 139, 250, 0.20) 0%,
            rgba(167, 139, 250, 0) 70%
        );
}

.auth-visual-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(
            110deg,
            rgba(255, 255, 255, 0.045),
            transparent 38%
        );
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(32px, 5vh, 64px);
}

.auth-brand,
.auth-mobile-brand {
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.auth-brand {
    align-self: flex-start;
}

.auth-brand:focus-visible,
.auth-mobile-brand:focus-visible,
.auth-password-toggle:focus-visible,
.auth-submit-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.72);
    outline-offset: 3px;
}

.auth-brand-copy,
.auth-mobile-brand .auth-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.auth-brand-copy strong,
.auth-mobile-brand .auth-brand-copy strong {
    max-width: 100%;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.auth-brand-copy small,
.auth-mobile-brand .auth-brand-copy small {
    max-width: 100%;
    opacity: 0.78;
    font-size: 0.82rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.auth-brand-logo {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 14px 32px rgba(14, 18, 70, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
}

.auth-mobile-brand .auth-brand-logo {
    border-color: rgba(79, 70, 229, 0.12);
    background:
        linear-gradient(
            135deg,
            rgba(79, 70, 229, 0.10),
            rgba(124, 58, 237, 0.14)
        );
    box-shadow:
        0 12px 28px rgba(79, 70, 229, 0.12);
}

.auth-google-icon {
    color: #fff;
    font-size: 30px;
}

.auth-mobile-brand .auth-google-icon {
    color: var(--account-primary);
}

.auth-visual-message {
    width: 100%;
    min-width: 0;
    max-width: 760px;
}

.auth-visual-badge {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 22px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
    font-size: 0.91rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.auth-visual-message h1 {
    max-width: 780px;
    margin: 0 0 18px;
    font-size: clamp(2.45rem, 4vw, 4.35rem);
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.045em;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.auth-visual-message p {
    max-width: 650px;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.98rem, 1.15vw, 1.08rem);
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.auth-feature-grid {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.auth-feature {
    min-width: 0;
    min-height: 82px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.auth-feature > span {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
}

.auth-feature > div {
    min-width: 0;
}

.auth-feature strong,
.auth-feature small {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.auth-feature strong {
    display: block;
    font-size: 0.94rem;
    line-height: 1.3;
}

.auth-feature small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.80rem;
    line-height: 1.4;
}

/* =========================================================
   PANNEAU CONNEXION
========================================================= */

.auth-form-panel {
    position: relative;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        clamp(24px, 4vw, 56px)
        clamp(20px, 4vw, 62px);
}

.auth-form-panel::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -210px;
    bottom: -200px;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(
            circle,
            rgba(79, 70, 229, 0.10),
            transparent 68%
        );
}

.auth-form-wrapper {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    min-width: 0;
    max-width: 520px;
    padding: clamp(28px, 3vw, 40px);
    overflow: hidden;
    border: 1px solid rgba(214, 223, 237, 0.90);
    border-radius: var(--auth-radius-xl);
    background: var(--auth-card);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(22px);
}

.auth-form-wrapper::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            var(--account-primary),
            var(--company-accent)
        );
}

.auth-mobile-brand {
    display: none;
    margin-bottom: 24px;
    color: var(--auth-text);
}

.auth-heading {
    min-width: 0;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: start;
    gap: 17px;
    margin-bottom: 24px;
}

.auth-heading > div {
    min-width: 0;
}

.auth-heading-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--account-primary),
            var(--company-accent)
        );
    box-shadow:
        0 14px 30px rgba(79, 70, 229, 0.20);
}

.auth-heading-icon .material-symbols-rounded {
    font-size: 29px;
}

.auth-eyebrow {
    max-width: 100%;
    margin-bottom: 7px;
    display: inline-block;
    color: var(--account-primary);
    font-size: 0.76rem;
    font-weight: 850;
    line-height: 1.35;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.auth-heading h2 {
    max-width: 100%;
    margin: 0 0 7px;
    color: var(--auth-text);
    font-size: clamp(1.75rem, 2.3vw, 2.15rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.auth-heading p {
    max-width: 100%;
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.94rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.auth-form {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field .form-label {
    max-width: 100%;
    margin: 0;
    color: var(--auth-text);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.auth-input-group {
    position: relative;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
}

.auth-input-group input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 56px;
    margin: 0;
    padding: 0 52px;
    border: 1px solid var(--auth-border);
    border-radius: 17px;
    outline: none;
    color: var(--auth-text);
    background: #f8faff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.90);
    font-size: 0.96rem;
    line-height: 1;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}

.auth-input-group input:hover {
    border-color: #c7d2e4;
    background: #fff;
}

.auth-input-group input:focus {
    border-color: var(--account-primary);
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(79, 70, 229, 0.10);
}

.auth-input-icon {
    position: absolute;
    left: 16px;
    z-index: 2;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--account-primary);
    pointer-events: none;
}

.auth-password-toggle {
    position: absolute;
    right: 11px;
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    color: var(--auth-muted);
    background: transparent;
    cursor: pointer;
    transition:
        color 0.16s ease,
        background-color 0.16s ease;
}

.auth-password-toggle:hover {
    color: var(--account-primary);
    background: rgba(79, 70, 229, 0.08);
}

.auth-field-error {
    max-width: 100%;
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    color: #b42318;
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.auth-options {
    width: 100%;
    min-width: 0;
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-remember {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--auth-text);
    font-size: 0.91rem;
    font-weight: 650;
    cursor: pointer;
}

.auth-remember .form-check-input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 0;
}

.auth-session-note {
    flex: 0 0 auto;
    color: var(--auth-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.auth-submit-button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 56px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    border: 0;
    border-radius: 17px;
    color: #fff;
    background:
        linear-gradient(
            100deg,
            var(--account-primary),
            var(--company-accent)
        );
    box-shadow:
        0 14px 28px rgba(79, 70, 229, 0.22);
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition:
        filter 0.16s ease,
        box-shadow 0.16s ease;
}

.auth-submit-button:hover {
    filter: brightness(1.04);
    box-shadow:
        0 14px 28px rgba(79, 70, 229, 0.26);
}

.auth-submit-button:active {
    filter: brightness(0.98);
}

.auth-submit-button:disabled {
    cursor: wait;
    opacity: 0.82;
}

.auth-submit-button > * {
    flex: 0 0 auto;
}

.auth-footer {
    width: 100%;
    min-width: 0;
    margin-top: 22px;
    padding-top: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
    color: var(--auth-muted);
    font-size: 0.83rem;
    line-height: 1.4;
}

.auth-footer > span,
.auth-footer small {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.auth-footer > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.auth-footer small {
    text-align: right;
}

.auth-alert {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 14px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    overflow: hidden;
    border: 1px solid rgba(25, 135, 84, 0.10);
    border-radius: 15px;
    box-shadow: none;
    font-size: 0.88rem;
    line-height: 1.45;
}

.auth-alert > * {
    min-width: 0;
}

.auth-alert span,
.auth-alert div {
    overflow-wrap: anywhere;
}

.auth-messages {
    width: 100%;
    min-width: 0;
    margin-bottom: 16px;
}

/* =========================================================
   TABLETTE / PETIT DESKTOP
========================================================= */

@media (max-width: 1180px) {
    .auth-shell {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(400px, 0.88fr);
    }

    .auth-visual-panel {
        padding: 32px;
    }

    .auth-feature-grid {
        grid-template-columns: 1fr;
        max-width: 390px;
    }

    .auth-feature {
        min-height: 68px;
    }

    .auth-visual-message h1 {
        font-size: clamp(2.2rem, 4vw, 3.4rem);
    }

    .auth-form-panel {
        padding: 26px 22px;
    }
}

/* =========================================================
   TABLETTE / MOBILE
========================================================= */

@media (max-width: 899.98px) {
    body.auth-page {
        min-height: 100vh;
        min-height: 100svh;
        background:
            radial-gradient(
                circle at 15% 0%,
                rgba(79, 70, 229, 0.15),
                transparent 18rem
            ),
            linear-gradient(
                180deg,
                #eef2ff 0%,
                #f8fafc 38%,
                #f8fafc 100%
            );
    }

    .auth-shell {
        min-height: 100vh;
        min-height: 100svh;
        display: block;
        overflow: visible;
    }

    .auth-visual-panel {
        display: none;
    }

    .auth-form-panel {
        width: 100%;
        min-height: 100vh;
        min-height: 100svh;
        overflow: visible;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding:
            max(22px, env(safe-area-inset-top))
            18px
            max(22px, env(safe-area-inset-bottom));
    }

    .auth-form-panel::before {
        width: 320px;
        height: 320px;
        right: -170px;
        bottom: -160px;
    }

    .auth-form-wrapper {
        width: min(100%, 560px);
        max-width: 560px;
        margin-block: auto;
        padding: 26px 24px;
        border-radius: 26px;
        box-shadow:
            0 22px 54px rgba(30, 41, 59, 0.12);
    }

    .auth-mobile-brand {
        width: fit-content;
        max-width: 100%;
        margin-bottom: 26px;
        display: inline-flex;
        align-items: center;
        gap: 12px;
    }

    .auth-mobile-brand .auth-brand-copy strong {
        font-size: 1rem;
    }

    .auth-heading {
        grid-template-columns: 54px minmax(0, 1fr);
        align-items: center;
        gap: 14px;
        margin-bottom: 22px;
    }

    .auth-heading-icon {
        width: 54px;
        height: 54px;
        border-radius: 17px;
    }

    .auth-heading h2 {
        font-size: 1.65rem;
    }

    .auth-input-group input,
    .auth-submit-button {
        height: 54px;
    }

    .auth-input-group input {
        font-size: 16px;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 575.98px) {
    body.auth-page {
        height: 100vh;
        height: 100svh;
        min-height: 100vh;
        min-height: 100svh;
        overflow: hidden;
        background: #ffffff;
    }

    .auth-shell {
        height: 100%;
        min-height: 0;
        overflow: hidden;
        background: #ffffff;
    }

    .auth-form-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        align-items: stretch;
        justify-content: flex-start;
        background: #ffffff;
        scrollbar-width: none;
    }

    .auth-form-panel::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .auth-form-panel::before {
        display: none;
    }

    .auth-form-wrapper {
        width: 100%;
        max-width: 100%;
        min-height: 100%;
        margin: 0;
        padding:
            max(20px, env(safe-area-inset-top))
            16px
            max(18px, env(safe-area-inset-bottom));
        border: 0;
        border-radius: 0;
        background: #ffffff;
        box-shadow: none;
        backdrop-filter: none;
    }

    .auth-form-wrapper::before {
        height: 3px;
    }

    .auth-mobile-brand {
        margin-bottom: 20px;
    }

    .auth-brand-logo {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
        border-radius: 15px;
    }

    .auth-heading {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .auth-heading-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .auth-heading-icon .material-symbols-rounded {
        font-size: 25px;
    }

    .auth-eyebrow {
        margin-bottom: 5px;
        font-size: 0.70rem;
        letter-spacing: 0.075em;
    }

    .auth-heading h2 {
        margin-bottom: 5px;
        font-size: 1.42rem;
    }

    .auth-heading p {
        font-size: 0.87rem;
        line-height: 1.45;
    }

    .auth-form {
        gap: 16px;
    }

    .auth-field .form-label {
        font-size: 0.88rem;
    }

    .auth-input-group input {
        height: 52px;
        padding-right: 48px;
        padding-left: 48px;
        border-radius: 15px;
        font-size: 16px;
    }

    .auth-input-icon {
        left: 14px;
    }

    .auth-password-toggle {
        right: 8px;
        width: 36px;
        height: 36px;
    }

    .auth-options {
        min-height: 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .auth-session-note {
        white-space: normal;
    }

    .auth-submit-button {
        height: 52px;
        border-radius: 15px;
        font-size: 0.93rem;
    }

    .auth-alert {
        padding: 12px 13px;
        font-size: 0.84rem;
    }

    .auth-footer {
        margin-top: 18px;
        padding-top: 15px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        font-size: 0.80rem;
    }

    .auth-footer small {
        text-align: left;
    }
}


/* Mobile court : le panneau devient scrollable uniquement si nécessaire. */
@media (max-width: 575.98px) and (max-height: 680px) {
    .auth-mobile-brand {
        margin-bottom: 14px;
    }

    .auth-heading {
        margin-bottom: 16px;
    }

    .auth-form {
        gap: 14px;
    }

    .auth-footer {
        margin-top: 14px;
    }
}

/* =========================================================
   PETITS TELEPHONES
========================================================= */

@media (max-width: 360px) {
    .auth-form-panel {
        padding-right: 6px;
        padding-left: 6px;
    }

    .auth-form-wrapper {
        padding-right: 13px;
        padding-left: 13px;
        border-radius: 18px;
    }

    .auth-heading {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 10px;
    }

    .auth-heading-icon {
        width: 44px;
        height: 44px;
    }

    .auth-heading h2 {
        font-size: 1.28rem;
    }

    .auth-brand-copy strong,
    .auth-mobile-brand .auth-brand-copy strong {
        font-size: 0.94rem;
    }
}

/* =========================================================
   ACCESSIBILITE / STABILITE VISUELLE
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .auth-input-group input,
    .auth-password-toggle,
    .auth-submit-button {
        transition: none;
    }
}


/* =========================================================
   PROFIL UTILISATEUR + MODIFICATION DU PROFIL
   Version 20.1
========================================================= */

.profile-page,
.account-profile-edit-page {
    width: 100%;
    min-width: 0;
}

.profile-layout,
.account-form-layout {
    width: 100%;
    min-width: 0;
    max-width: 1500px;
    margin: 0 auto;
}

/* ---------------------------------------------------------
   PAGE MON PROFIL
--------------------------------------------------------- */

.profile-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.profile-identity-card,
.profile-panel,
.account-form-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.profile-identity-card {
    position: sticky;
    top: 92px;
}

.profile-cover {
    height: 132px;
    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(255, 255, 255, 0.3),
            transparent 25%
        ),
        linear-gradient(
            135deg,
            var(--account-primary),
            var(--company-accent)
        );
}

.profile-identity-content {
    padding: 0 24px 28px;
    text-align: center;
}

.profile-avatar-wrapper {
    position: relative;
    width: 118px;
    height: 118px;
    margin: -59px auto 18px;
    border: 5px solid #ffffff;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.profile-avatar-image,
.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.profile-avatar-image {
    display: block;
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--account-primary),
            var(--company-accent)
        );
    font-size: 2.6rem;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-status-indicator {
    position: absolute;
    right: 5px;
    bottom: 7px;
    width: 20px;
    height: 20px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: #22c55e;
}

.profile-identity-content h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.55rem;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.profile-identity-content > p {
    margin: 7px 0 14px;
    color: #64748b;
    overflow-wrap: anywhere;
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    max-width: 100%;
    padding: 8px 13px;
    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: 999px;
    color: var(--account-primary-dark);
    background: rgba(79, 70, 229, 0.08);
    font-size: 0.83rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.profile-main-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 24px;
}

.profile-main-actions .btn {
    width: 100%;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    font-weight: 750;
}

.profile-information-column {
    min-width: 0;
    display: grid;
    gap: 24px;
}

.profile-panel {
    padding: 24px;
}

.profile-panel-header,
.account-form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.profile-panel-header > div,
.account-form-header > div {
    min-width: 0;
}

.profile-panel-header h2,
.account-form-header h2 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 1.3rem;
    font-weight: 850;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.account-form-header p {
    margin: 7px 0 0;
    color: #64748b;
    line-height: 1.6;
}

.profile-panel-icon,
.account-form-header-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--account-primary),
            var(--company-accent)
        );
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.2);
    font-size: 1.35rem;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-detail {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #f8fafc;
}

.profile-detail-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: var(--account-primary);
    background: rgba(79, 70, 229, 0.1);
    font-size: 1.08rem;
}

.profile-detail > div {
    min-width: 0;
}

.profile-detail small {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 0.77rem;
    font-weight: 700;
}

.profile-detail strong {
    display: block;
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 800;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.account-status-list {
    display: grid;
    gap: 10px;
}

.account-status-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
    align-items: center;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
}

.account-status-item > span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-weight: 700;
}

.account-status-item strong {
    min-width: 0;
    color: #0f172a;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------
   PAGE MODIFIER MON PROFIL
--------------------------------------------------------- */

.account-form-layout {
    display: flex;
    justify-content: center;
}

.account-form-card {
    width: 100%;
    max-width: 980px;
    padding: 28px;
}

.avatar-edit-section {
    min-width: 0;
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    margin-bottom: 26px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            rgba(79, 70, 229, 0.06),
            rgba(124, 58, 237, 0.04)
        );
}

.avatar-preview-wrapper {
    width: 128px;
    height: 128px;
    justify-self: center;
    overflow: hidden;
    border: 5px solid #ffffff;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.13);
}

.avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--account-primary),
            var(--company-accent)
        );
    font-size: 2.5rem;
    font-weight: 900;
}

.avatar-edit-copy {
    min-width: 0;
}

.avatar-edit-copy h3 {
    margin: 0 0 7px;
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 850;
}

.avatar-edit-copy p {
    margin: 0 0 13px;
    color: #64748b;
    line-height: 1.55;
}

.avatar-edit-copy input[type="file"] {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 7px;
    border: 1px dashed #cbd5e1;
    border-radius: 13px;
    color: #475569;
    background: #ffffff;
    cursor: pointer;
}

.avatar-edit-copy input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: var(--account-primary);
    font-weight: 750;
    cursor: pointer;
}

.account-form-card form {
    width: 100%;
    min-width: 0;
}

.account-form-card .row {
    min-width: 0;
}

.account-form-card .form-label {
    margin-bottom: 7px;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 800;
}

.account-form-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.account-form-card select,
.account-form-card textarea {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 11px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.03);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.account-form-card textarea {
    min-height: 110px;
    resize: vertical;
}

.account-form-card input:focus,
.account-form-card select:focus,
.account-form-card textarea:focus {
    border-color: var(--account-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.11);
}

.form-error {
    margin-top: 6px;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 700;
}

.account-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.account-form-actions .btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-inline: 18px;
    border-radius: 14px;
    font-weight: 750;
}

/* ---------------------------------------------------------
   TABLETTE
--------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .profile-layout {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .profile-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-identity-card {
        position: static;
    }

    .profile-main-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------------------------------------------------------
   MOBILE
--------------------------------------------------------- */

@media (max-width: 767.98px) {
    .profile-layout,
    .account-form-layout,
    .profile-information-column {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .profile-layout,
    .profile-information-column {
        gap: 14px;
    }

    .profile-identity-card,
    .profile-panel,
    .account-form-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-radius: 20px;
    }

    .profile-cover {
        height: 105px;
    }

    .profile-identity-content {
        padding: 0 16px 20px;
    }

    .profile-avatar-wrapper {
        width: 100px;
        height: 100px;
        margin-top: -50px;
    }

    .profile-identity-content h2 {
        font-size: 1.3rem;
    }

    .profile-main-actions {
        grid-template-columns: 1fr;
    }

    .profile-panel {
        padding: 17px;
    }

    .profile-panel-header,
    .account-form-header {
        align-items: center;
        gap: 12px;
        margin-bottom: 17px;
    }

    .profile-panel-header h2,
    .account-form-header h2 {
        font-size: 1.08rem;
    }

    .profile-panel-icon,
    .account-form-header-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 13px;
        font-size: 1.1rem;
    }

    .profile-details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .profile-detail {
        padding: 12px;
    }

    .account-status-item {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 12px;
    }

    .account-status-item strong {
        text-align: left;
    }

    .account-form-card {
        padding: 17px;
    }

    .avatar-edit-section {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
        text-align: center;
    }

    .avatar-preview-wrapper {
        width: 106px;
        height: 106px;
    }

    .avatar-edit-copy input[type="file"] {
        text-align: left;
        font-size: 0.82rem;
    }

    .account-form-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    .account-form-card select,
    .account-form-card textarea {
        min-height: 48px;
        font-size: 16px;
    }

    .account-form-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 22px;
    }

    .account-form-actions .btn {
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 390px) {
    .profile-panel,
    .account-form-card {
        padding: 14px;
    }

    .profile-detail {
        gap: 9px;
        padding: 10px;
    }

    .profile-detail-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .profile-panel-header h2,
    .account-form-header h2 {
        font-size: 1rem;
    }
}