:root {
    --ecp-red: #9E0A34;
    --ecp-red-dark: #7D0829;
    --ecp-red-soft: #F6E9ED;

    --ecp-grey: #6E6F71;
    --ecp-grey-dark: #4F5052;
    --ecp-grey-light: #ECEDEE;

    --background: #F5F5F5;
    --surface: #FFFFFF;
    --text: #353638;
    --muted: #77787A;
    --border: #D9DADB;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(110,111,113,.08), rgba(158,10,52,.06)),
        var(--background);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: 18px;
    border-top: 6px solid var(--ecp-red);
    padding: 42px;
    box-shadow: 0 16px 46px rgba(0,0,0,.13);
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
}

.login-logo {
    width: 100%;
    max-width: 340px;
    height: auto;
    display: block;
}

.subtitle {
    margin: 16px 0 30px;
    text-align: center;
    color: var(--ecp-grey);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .02em;
}

label {
    display: block;
    margin-top: 18px;
    margin-bottom: 7px;
    color: var(--ecp-grey-dark);
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
}

input:focus {
    outline: 3px solid rgba(158,10,52,.13);
    border-color: var(--ecp-red);
}

button {
    width: 100%;
    min-height: 54px;
    margin-top: 28px;
    border: 0;
    border-radius: 9px;
    background: var(--ecp-red);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    background: var(--ecp-red-dark);
}

.error {
    background: var(--ecp-red-soft);
    color: var(--ecp-red-dark);
    border-left: 4px solid var(--ecp-red);
    padding: 13px 14px;
    margin-bottom: 18px;
    border-radius: 6px;
    font-weight: 700;
}

/* PORTAIL */

.header {
    min-height: 82px;
    background: #fff;
    border-bottom: 5px solid var(--ecp-red);
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 30px;
}

.header-logo-wrap {
    display: flex;
    align-items: center;
}

.header-logo {
    width: 245px;
    max-width: 45vw;
    height: auto;
    display: block;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--ecp-grey-dark);
    font-weight: 700;
}

.header-user a {
    color: var(--ecp-red);
    text-decoration: none;
    font-weight: 800;
}

.header-user a:hover {
    text-decoration: underline;
}

.portal-main {
    max-width: 1150px;
    margin: 0 auto;
    padding: 42px 24px;
}

.page-heading {
    margin-bottom: 30px;
}

.page-heading h1 {
    margin: 0 0 8px;
    color: var(--ecp-grey-dark);
    font-size: 32px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.applications {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}

.application-card {
    min-height: 190px;
    background: var(--surface);
    color: var(--ecp-grey-dark);
    text-decoration: none;
    border-radius: 16px;
    border: 1px solid var(--border);
    border-top: 5px solid var(--ecp-red);
    box-shadow: 0 6px 22px rgba(0,0,0,.07);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.application-card:hover {
    transform: translateY(-2px);
    border-color: rgba(158,10,52,.35);
    box-shadow: 0 11px 30px rgba(0,0,0,.13);
}

.application-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: var(--ecp-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 31px;
    font-weight: 800;
}

.application-title {
    color: var(--ecp-grey-dark);
    font-size: 20px;
    font-weight: 800;
}

.application-arrow {
    color: var(--ecp-red);
    font-weight: 800;
}

.empty-state {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 5px solid var(--ecp-red);
    border-radius: 10px;
    padding: 20px;
    color: var(--ecp-grey-dark);
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

@media (max-width: 650px) {
    .login-card {
        padding: 30px 22px;
    }

    .header {
        padding: 12px 18px;
        align-items: flex-start;
        flex-direction: column;
    }

    .header-logo {
        width: 220px;
        max-width: 80vw;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
        font-size: 14px;
    }

    .portal-main {
        padding: 30px 16px;
    }

    .page-heading h1 {
        font-size: 27px;
    }
}


/* ALIGNEMENT UTILISATEUR / DECONNEXION */

.header-user > span,
.header-user > a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    line-height: 1;
    margin: 0;
}

.header-user > span {
    padding: 0;
}

.header-user > a {
    padding: 0;
}


/* PASSWORD RESET */

.login-help {
    margin-top: 20px;
    text-align: center;
}

.login-help a {
    color: var(--ecp-red);
    text-decoration: none;
    font-weight: 700;
}

.login-help a:hover {
    text-decoration: underline;
}

.login-main-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 9px;
    background: var(--ecp-red);
    color: #fff !important;
    text-decoration: none !important;
}

.login-main-link:hover {
    background: var(--ecp-red-dark);
}

.form-intro {
    margin: -8px 0 22px;
    color: var(--muted);
    line-height: 1.5;
    text-align: center;
}

.success-message {
    background: #EEF7EF;
    color: #2E6B32;
    border-left: 4px solid #2E7D32;
    padding: 13px 14px;
    margin-bottom: 18px;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1.45;
}
