:root {
    --navy: #123456;
    --navy-light: #1b527e;
    --sky: #38a9e8;
    --sky-dark: #1687c5;
    --sky-pale: #eaf7ff;
    --gold: #d8b15a;
    --background: #f2f9fd;
    --white: #ffffff;
    --text: #1e293b;
    --muted: #6b7c91;
    --border: #dceaf3;
    --danger: #b42318;
    --success: #087443;
    --shadow: 0 12px 36px rgba(24, 91, 135, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.65;
}

a {
    color: var(--sky-dark);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--navy);
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

/* EN-TÊTE */

.site-header {
    background: linear-gradient(115deg, #123456, #176ba0);
    color: var(--white);
    padding: 20px 26px;
    border-bottom: 3px solid var(--sky);
}

.header-inner {
    width: min(1180px, 100%);
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    color: var(--white);
    font-size: clamp(21px, 2.5vw, 28px);
    font-weight: 800;
    letter-spacing: -.5px;
}

.brand span {
    color: #8ed7ff;
}

.header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 17px;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 10px;
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
}

.header-link:hover {
    background: rgba(255, 255, 255, .12);
    color: var(--white);
    text-decoration: none;
}

/* CONTENEURS */

.container,
.dashboard-container {
    width: min(1180px, calc(100% - 36px));
    margin: 36px auto;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 28px;
    align-items: stretch;
    min-height: 540px;
}

/* PANNEAU DE PRÉSENTATION */

.welcome-panel {
    padding: clamp(28px, 4vw, 48px);
    border-radius: 22px;
    background: linear-gradient(145deg, #123456, #176ba0);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.welcome-panel::after {
    content: "";
    position: absolute;
    width: 250px;
    height: 250px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    right: -100px;
    bottom: -100px;
    pointer-events: none;
}

.welcome-panel h1 {
    position: relative;
    z-index: 1;
    font-size: clamp(28px, 3.2vw, 43px);
    line-height: 1.2;
    letter-spacing: -.8px;
    margin: 20px 0 12px;
}

.welcome-panel p {
    position: relative;
    z-index: 1;
    color: #e0f2ff;
    font-size: 16px;
}

.demo-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 8px 13px;
    border: 1px solid rgba(142, 215, 255, .75);
    border-radius: 30px;
    color: #a5e0ff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
}

/* FORMULAIRES ET CARTES */

.auth-card,
.panel {
    min-width: 0;
    padding: clamp(24px, 3vw, 38px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin: 0 0 7px;
    color: var(--navy);
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.3;
    letter-spacing: -.5px;
}

.muted {
    color: var(--muted);
}

.auth-card > .muted {
    margin-bottom: 25px;
}

/* CHAMPS */

.form-group {
    margin: 21px 0;
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #26384b;
    font-weight: 650;
    font-size: 15px;
}

.form-group input,
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 12px 15px;
    border: 1px solid #cfdeea;
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9aa9b8;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #9acfeb;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 4px rgba(56, 169, 232, .15);
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    display: inline-block;
    width: auto;
    min-height: auto;
}

/* BOUTONS */

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 52px;
    padding: 13px 20px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(110deg, #1687c5, #176ba0);
    color: var(--white);
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(22, 135, 197, .18);
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn:hover {
    color: var(--white);
    text-decoration: none;
    box-shadow: 0 9px 22px rgba(22, 135, 197, .25);
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: 3px solid #8ed7ff;
    outline-offset: 3px;
}

.btn:active {
    transform: translateY(0);
}

/* MESSAGES */

.notice {
    padding: 14px 16px;
    border-radius: 11px;
    margin: 18px 0;
    background: var(--sky-pale);
    color: var(--navy);
    border: 1px solid #b8e3fa;
    overflow-wrap: anywhere;
}

.notice.error {
    background: #fff1f0;
    border-color: #ffd1cc;
    color: var(--danger);
}

.demo-warning,
.demo-notice {
    margin-top: 22px;
    padding: 15px 17px;
    border: 1px solid #c7eaff;
    border-radius: 12px;
    background: #eff9ff;
    color: #31556f;
    font-size: 13px;
}

/* PIED DE PAGE */

.site-footer {
    text-align: center;
    padding: 26px 18px;
    color: var(--muted);
    font-size: 13px;
}

/* TABLEAU DE BORD */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px max(24px, calc((100% - 1180px) / 2));
    background: linear-gradient(115deg, #123456, #176ba0);
    color: var(--white);
    border-bottom: 3px solid var(--sky);
}

.dashboard-header h1 {
    margin: 0;
    font-size: clamp(22px, 3vw, 29px);
    letter-spacing: -.5px;
}

.dashboard-header p {
    margin: 3px 0 0;
    color: #dcefff;
    font-size: 14px;
}

.dashboard-header > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 15px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 10px;
    font-weight: 600;
}

.dashboard-header > a:hover {
    background: rgba(255, 255, 255, .12);
    text-decoration: none;
}

.dashboard-container {
    display: grid;
    gap: 23px;
}

.welcome-card {
    padding: 27px 30px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.welcome-card > p {
    margin: 0 0 5px;
    color: var(--muted);
}

.welcome-card h2 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: clamp(25px, 3vw, 34px);
    overflow-wrap: anywhere;
}

.balance-card {
    padding: clamp(24px, 4vw, 35px);
    border: 1px solid #bce7fb;
    border-radius: 20px;
    color: var(--navy);
    background: linear-gradient(125deg, #dff5ff, #ffffff);
    box-shadow: var(--shadow);
}

.balance-card p {
    margin: 0;
    color: #42647c;
    font-weight: 650;
}

.balance-card h2,
.balance-card strong {
    display: block;
    margin: 8px 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.2;
    color: #126ca4;
    overflow-wrap: anywhere;
}

.balance-card small {
    color: var(--muted);
}

/* RUBRIQUES DU TABLEAU DE BORD */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-item {
    min-width: 0;
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 6px 22px rgba(24, 91, 135, .05);
    transition: transform .2s ease, box-shadow .2s ease;
}

.dashboard-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dashboard-item h3 {
    margin: 0 0 8px;
    color: var(--navy);
    font-size: 20px;
}

.dashboard-item p {
    color: var(--muted);
    margin: 0 0 14px;
    overflow-wrap: anywhere;
}

.dashboard-item span {
    display: inline-flex;
    padding: 6px 11px;
    border-radius: 30px;
    background: var(--sky-pale);
    color: #126ca4;
    font-size: 12px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.demo-notice {
    margin: 0;
}

/* PETITS ORDINATEURS ET TABLETTES */

@media (max-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .welcome-panel {
        min-height: 280px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* TÉLÉPHONES */

@media (max-width: 600px) {
    .site-header {
        padding: 17px 18px;
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .brand {
        font-size: 24px;
    }

    .header-link {
        min-height: 40px;
    }

    .container,
    .dashboard-container {
        width: calc(100% - 24px);
        margin: 18px auto;
    }

    .auth-layout {
        gap: 16px;
    }

    .welcome-panel {
        min-height: auto;
        padding: 25px 22px;
        border-radius: 17px;
    }

    .welcome-panel h1 {
        font-size: 30px;
    }

    .welcome-panel p {
        font-size: 15px;
    }

    .auth-card,
    .panel {
        padding: 23px 19px;
        border-radius: 17px;
    }

    .auth-card h2 {
        font-size: 27px;
    }

    .form-group {
        margin: 19px 0;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 53px;
        font-size: 16px;
    }

    .btn {
        min-height: 53px;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px 18px;
        gap: 14px;
    }

    .dashboard-header > a {
        width: 100%;
    }

    .welcome-card {
        padding: 22px 19px;
    }

    .balance-card {
        padding: 24px 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .dashboard-item {
        padding: 21px;
    }

    .site-footer {
        padding: 22px 16px;
    }
}

/* ACCESSIBILITÉ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}