/* =========================================================
   CLASSMIRROR — STYLE GLOBAL FINAL
   Navigation, boutons, formulaires, tableaux et pied de page
========================================================= */

/* =========================================================
   1. NORMALISATION
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    background: #f7f8fc;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: #292e3f;
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: #f7f8fc;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.navigation-open {
    overflow: hidden;
}

main {
    display: block;
    min-width: 0;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: #5a3fd0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

::selection {
    color: #ffffff;
    background: #6c4df6;
}

/* =========================================================
   2. ACCESSIBILITÉ
========================================================= */

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 20000;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    background: #4f35c5;
    border-radius: 10px;
    box-shadow:
        0 12px 30px
        rgba(39, 25, 101, 0.24);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

html[dir="rtl"] .skip-link {
    right: 10px;
    left: auto;
}

:focus-visible {
    outline: 3px solid rgba(108, 77, 246, 0.30);
    outline-offset: 3px;
}

#main-content:focus {
    outline: none;
}

/* =========================================================
   3. NAVIGATION PRINCIPALE
========================================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #e7e9f1;
    box-shadow:
        0 5px 20px
        rgba(33, 37, 53, 0.04);
    backdrop-filter: blur(14px);
}

.nav-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(1180px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
}

.logo {
    flex: 0 0 auto;
    color: #252a3b;
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.logo span {
    color: #6c4df6;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.nav-links > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
    color: #4f5568;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border-radius: 9px;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.nav-links > a:hover {
    color: #5a3fd0;
    background: #f3f0ff;
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-links > a.active,
.nav-links > a[aria-current="page"] {
    color: #5539c6;
    background: #efecff;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 41px;
    padding: 8px 14px;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none !important;
    background: #6c4df6;
    border: 1px solid #6c4df6;
    border-radius: 11px;
    box-shadow:
        0 9px 20px
        rgba(89, 61, 209, 0.18);
}

.nav-button:hover {
    color: #ffffff !important;
    background: #5c40dd;
    border-color: #5c40dd;
}

.nav-button.secondary {
    color: #5a3fd0 !important;
    background: #ffffff;
    border-color: #d9d2ff;
    box-shadow: none;
}

.nav-button.secondary:hover {
    color: #4c32bd !important;
    background: #f3f0ff;
}

/* =========================================================
   4. BOUTON DU MENU MOBILE
========================================================= */

.mobile-menu-button {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #f4f2ff;
    border: 1px solid #dfd9fb;
    border-radius: 12px;
    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    width: 21px;
    height: 2px;
    background: #4935a5;
    border-radius: 999px;
    transition:
        transform 0.18s ease,
        opacity 0.18s ease;
}

.mobile-menu-button.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-button.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   5. SÉLECTEUR DE LANGUE
========================================================= */

.language-switcher {
    position: relative;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
    padding: 3px;
    background: #f6f5fb;
    border: 1px solid #e5e2f2;
    border-radius: 10px;
}

.language-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 29px;
    padding: 0 6px;
    color: #5d6272;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    background: transparent;
    border-radius: 7px;
}

.language-switcher a:hover {
    color: #5a3fd0;
    background: #ece8ff;
    text-decoration: none;
}

.language-switcher a.active {
    color: #ffffff;
    background: #6c4df6;
    box-shadow:
        0 5px 12px
        rgba(80, 52, 190, 0.20);
}

/* =========================================================
   6. MENU DU COMPTE
========================================================= */

.account-menu {
    position: relative;
    flex: 0 0 auto;
}

.account-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 41px;
    padding: 7px 12px;
    color: #4f3aaa;
    font-size: 12px;
    font-weight: 900;
    background: #f2efff;
    border: 1px solid #ddd7fa;
    border-radius: 11px;
    cursor: pointer;
}

.account-menu-button:hover,
.account-menu-button.active {
    color: #ffffff;
    background: #6648e3;
    border-color: #6648e3;
}

.account-menu-arrow {
    font-size: 11px;
    transition: transform 0.18s ease;
}

.account-menu.open .account-menu-arrow {
    transform: rotate(180deg);
}

.account-plan-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 21px;
    padding: 2px 7px;
    color: #5137bc;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #ffffff;
    border-radius: 999px;
}

.account-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1200;
    display: none;
    width: min(270px, calc(100vw - 32px));
    padding: 9px;
    background: #ffffff;
    border: 1px solid #e2e4ec;
    border-radius: 15px;
    box-shadow:
        0 20px 45px
        rgba(32, 27, 66, 0.16);
}

html[dir="rtl"] .account-menu-panel {
    right: auto;
    left: 0;
}

.account-menu.open .account-menu-panel {
    display: grid;
    gap: 3px;
}

.account-menu-panel a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 11px;
    color: #4f5568;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    border-radius: 9px;
}

.account-menu-panel a:hover,
.account-menu-panel a.active,
.account-menu-panel a[aria-current="page"] {
    color: #5539c6;
    background: #f0edff;
    text-decoration: none;
}

.account-menu-panel .account-menu-logout {
    color: #9a2e3b;
}

.account-menu-panel .account-menu-logout:hover {
    color: #8c1e2d;
    background: #fff0f2;
}

.account-menu-separator {
    height: 1px;
    margin: 5px 4px;
    background: #eceef4;
}

/* =========================================================
   7. BOUTONS GLOBAUX
========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 9px 17px;
    color: #4b5162;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #dde0e8;
    border-radius: 12px;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.button:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.button-primary {
    color: #ffffff;
    background: #6c4df6;
    border-color: #6c4df6;
    box-shadow:
        0 10px 22px
        rgba(84, 56, 199, 0.18);
}

.button-primary:hover {
    color: #ffffff;
    background: #5c40dd;
    border-color: #5c40dd;
}

.button-secondary,
.button.outline,
button.outline {
    color: #5a3fd0;
    background: #ffffff;
    border-color: #d8d1ff;
}

.button-secondary:hover,
.button.outline:hover,
button.outline:hover {
    color: #4f34bf;
    background: #f3f0ff;
    border-color: #bdb2fa;
}

.button-danger {
    color: #ffffff;
    background: #b33b4a;
    border-color: #b33b4a;
}

.button-danger:hover {
    color: #ffffff;
    background: #982b39;
    border-color: #982b39;
}

.button[disabled],
button[disabled],
input[disabled],
select[disabled],
textarea[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

.button[aria-busy="true"],
button[aria-busy="true"] {
    cursor: wait;
}

/* =========================================================
   8. BADGES ET MESSAGES
========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 11px;
    color: #5b3fd0;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    background: #efecff;
    border: 1px solid #ded7ff;
    border-radius: 999px;
}

.form-error,
.alert-error {
    padding: 13px 15px;
    color: #951f2b;
    line-height: 1.55;
    background: #fff0f2;
    border: 1px solid #f4c9cf;
    border-radius: 12px;
}

.form-success,
.alert-success {
    padding: 13px 15px;
    color: #146641;
    line-height: 1.55;
    background: #eaf9f2;
    border: 1px solid #bcebd5;
    border-radius: 12px;
}

.alert-warning {
    padding: 13px 15px;
    color: #86560f;
    line-height: 1.55;
    background: #fff6e4;
    border: 1px solid #efd9a9;
    border-radius: 12px;
}

.alert-info {
    padding: 13px 15px;
    color: #2e568f;
    line-height: 1.55;
    background: #edf4ff;
    border: 1px solid #cadcf7;
    border-radius: 12px;
}

/* =========================================================
   9. FORMULAIRES
========================================================= */

form {
    min-width: 0;
}

label {
    display: inline-block;
    margin-bottom: 7px;
    color: #3f4557;
    font-size: 13px;
    font-weight: 850;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    color: #2d3242;
    background: #ffffff;
    border: 1px solid #dfe2ea;
    border-radius: 11px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

input,
select {
    min-height: 45px;
    padding: 9px 12px;
}

textarea {
    min-height: 120px;
    padding: 12px;
    line-height: 1.6;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #a0a4b2;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #c9cce0;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6c4df6;
    outline: none;
    box-shadow:
        0 0 0 4px
        rgba(108, 77, 246, 0.11);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: 0;
    margin: 0;
    accent-color: #6c4df6;
}

input[type="file"] {
    padding: 7px;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

legend {
    margin-bottom: 8px;
    color: #343949;
    font-weight: 900;
}

/* =========================================================
   10. CARTES ET PAGES SIMPLES
========================================================= */

.simple-page {
    min-height: 70vh;
    padding: 64px 20px;
}

.simple-page-card {
    width: min(850px, 100%);
    margin: 0 auto;
    padding: 36px;
    background: #ffffff;
    border: 1px solid #e7e9f1;
    border-radius: 24px;
    box-shadow:
        0 18px 45px
        rgba(31, 35, 48, 0.07);
}

.simple-page-card h1 {
    margin: 15px 0 13px;
    color: #24293a;
    font-size: clamp(32px, 5vw, 50px);
    line-height: 1.1;
}

.simple-page-card p,
.legal-copy {
    line-height: 1.75;
}

.legal-copy h2 {
    margin-top: 32px;
    color: #2c3142;
}

.card,
.panel {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e5e7ef;
    border-radius: 18px;
    box-shadow:
        0 12px 35px
        rgba(39, 42, 60, 0.06);
}

/* =========================================================
   11. TABLEAUX
========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e4e6ee;
    border-radius: 14px;
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 14px;
    text-align: start;
    vertical-align: top;
    border-bottom: 1px solid #eceef4;
}

th {
    color: #42485a;
    font-size: 12px;
    font-weight: 900;
    background: #f7f7fb;
}

td {
    color: #616779;
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #faf9ff;
}

/* =========================================================
   12. PIED DE PAGE
========================================================= */

.site-footer {
    width: 100%;
    padding: 52px 20px 22px;
    color: #d8dbe5;
    background: #202434;
}

.footer-container {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.35fr)
        repeat(3, minmax(150px, 0.8fr));
    gap: 32px;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.footer-brand,
.footer-column {
    min-width: 0;
}

.footer-logo {
    display: inline-flex;
    margin-bottom: 13px;
    color: #ffffff;
    font-size: 23px;
    font-weight: 950;
    letter-spacing: -0.035em;
    text-decoration: none;
}

.footer-logo:hover {
    color: #ffffff;
    text-decoration: none;
}

.footer-brand p {
    max-width: 350px;
    margin: 0;
    color: #adb2c1;
    font-size: 13px;
    line-height: 1.75;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.footer-column h3 {
    margin: 0 0 5px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.footer-column a,
.footer-portal-form button {
    padding: 0;
    color: #c8cbda;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-align: start;
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.footer-column a:hover,
.footer-portal-form button:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-portal-form {
    margin: 0;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 20px;
    width: min(1180px, 100%);
    margin: 36px auto 0;
    padding-top: 19px;
    color: #9095a7;
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.footer-bottom p {
    margin: 0;
}

/* =========================================================
   13. DIRECTION RTL
========================================================= */

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .language-switcher {
    direction: ltr;
}

html[dir="rtl"] .footer-column {
    align-items: flex-start;
}

html[dir="rtl"] th,
html[dir="rtl"] td {
    text-align: right;
}

/* =========================================================
   14. RESPONSIVE
========================================================= */

@media (max-width: 1080px) {
    .nav-links {
        gap: 3px;
    }

    .nav-links > a {
        padding-right: 7px;
        padding-left: 7px;
        font-size: 12px;
    }

    .footer-container {
        grid-template-columns:
            minmax(220px, 1fr)
            repeat(2, minmax(150px, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .nav-container {
        min-height: 68px;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        z-index: 1100;
        display: none;
        max-height: calc(100vh - 94px);
        padding: 14px;
        overflow-y: auto;
        background: #ffffff;
        border: 1px solid #e4e6ee;
        border-radius: 17px;
        box-shadow:
            0 20px 50px
            rgba(29, 27, 52, 0.17);
    }

    .nav-links.open {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 5px;
    }

    .nav-links > a,
    .nav-button {
        width: 100%;
        min-height: 43px;
        text-align: center;
    }

    .language-switcher {
        align-self: center;
        margin: 3px 0;
    }

    .account-menu {
        width: 100%;
    }

    .account-menu-button {
        width: 100%;
    }

    .account-menu-panel {
        position: static;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
    }
}

@media (max-width: 720px) {
    .footer-container {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 28px 22px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .nav-container {
        width: min(100% - 22px, 1180px);
    }

    .logo {
        font-size: 22px;
    }

    .simple-page {
        padding: 36px 13px 56px;
    }

    .simple-page-card {
        padding: 24px;
        border-radius: 19px;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .button {
        max-width: 100%;
    }
}

/* =========================================================
   15. IMPRESSION ET MOUVEMENTS RÉDUITS
========================================================= */

@media print {
    .navbar,
    .site-footer,
    .skip-link {
        display: none !important;
    }

    body {
        color: #000000;
        background: #ffffff;
    }

    main {
        width: 100%;
    }

    a {
        color: #000000;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}