.auth-shell {
    color: #222;
}

/* The historical #contenu height is bounded by its parent and does not follow long forms. */
.auth-shell--integrated #contenu {
    height: auto;
    display: flow-root;
}

/* Let the shared header and footer follow their content on integrated auth pages. */
.auth-shell--integrated #bandeau,
.auth-shell--integrated #piedpage {
    height: auto;
}

.auth-shell .auth-card,
.auth-shell .auth-card * {
    box-sizing: border-box;
}

.auth-shell--standalone {
    min-height: 100vh;
    background: #f3f3f3;
    background-image: none;
    background-attachment: initial;
}

.auth-main {
    width: calc(100% - 32px);
    max-width: 640px;
    margin: 32px auto 56px;
    padding: 0;
}

.auth-card {
    width: 100%;
    padding: clamp(22px, 5vw, 42px);
    background: #fff;
    border: 1px solid #d8d8d8;
    border-top: 5px solid #b3121b;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgb(0 0 0 / 8%);
}

.auth-card h1 {
    margin: 0 0 26px;
    color: #a30f17;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
    text-align: center;
}

.auth-brand {
    width: calc(100% - 32px);
    max-width: 640px;
    margin: 30px auto 0;
    text-align: center;
}

.auth-brand img {
    max-width: min(100%, 280px);
    height: auto;
}

.auth-language {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.auth-language button {
    min-width: 44px;
    min-height: 44px;
    padding: 5px;
    border: 1px solid #777;
    border-radius: 4px;
    background: #fff;
    color: #222;
    cursor: pointer;
}

.auth-language img {
    display: block;
    width: 32px;
    height: auto;
}

.auth-language button[aria-current="true"] {
    border-color: #a30f17;
    color: #a30f17;
    font-weight: 700;
}

.auth-standalone-footer {
    padding: 0 16px 32px;
    text-align: center;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    min-width: 0;
}

.auth-field label,
.auth-field legend {
    display: block;
    width: auto;
    margin: 0 0 7px;
    font-weight: 600;
    text-align: left;
}

.auth-input {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #777;
    border-radius: 4px;
    background: #fff;
    color: #222;
}

textarea.auth-input {
    min-height: 100px;
    resize: vertical;
}

.auth-input[aria-invalid="true"] {
    border-color: #ad1320;
    border-width: 2px;
}

.auth-password {
    display: flex;
    align-items: stretch;
}

.auth-password .auth-input {
    min-width: 0;
    border-radius: 4px 0 0 4px;
}

.auth-toggle {
    flex: 0 0 44px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid #555;
    border-left: 0;
    border-radius: 0 4px 4px 0;
    background: #eee;
    color: #222;
}

.auth-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-toggle[aria-pressed="false"] .auth-icon-hide,
.auth-toggle[aria-pressed="true"] .auth-icon-show {
    display: none;
}

.auth-button {
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid #8d0b12;
    border-radius: 4px;
    background: #ad111a;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.auth-button:hover,
.auth-button:focus {
    background: #860c13;
    color: #fff;
}

.auth-shell :focus-visible {
    outline: 3px solid #185aa0;
    outline-offset: 2px;
}

.auth-notice {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-left: 4px solid #555;
    background: #f2f2f2;
    line-height: 1.5;
}

.auth-notice[hidden] {
    display: none;
}

.auth-notice--error {
    border-color: #a50c16;
    background: #fff0f1;
}

.auth-notice--success {
    border-color: #227340;
    background: #eaf7ed;
}

.auth-notice--pending {
    border-color: #926000;
    background: #fff6df;
}

.auth-recovery {
    margin: 0 0 24px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    text-align: center;
}

.auth-recovery p {
    margin: 0 0 6px;
}

.auth-recovery a {
    color: #861017;
    text-decoration: underline;
}

.auth-field-error {
    margin: 6px 0 0;
    color: #a50c16;
    font-weight: 600;
}

.auth-criteria {
    padding: 12px 14px;
    border-radius: 4px;
    background: #f4f4f4;
    font-size: 14px;
}

.auth-criteria p {
    margin: 0 0 6px;
}

.auth-criteria ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 16px;
    margin: 0 0 8px;
    padding-left: 20px;
}

.auth-criteria li.auth-rule-met {
    color: #176333;
}

.auth-rule-icon {
    display: inline-block;
    width: 1.2em;
    font-weight: 700;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    margin-top: 22px;
    text-align: center;
}

.auth-links a,
.auth-standalone-footer a {
    color: #861017;
    text-decoration: underline;
}

.auth-section {
    display: grid;
    gap: 18px;
    min-width: 0;
    padding: 0;
    border: 0;
}

.auth-section legend {
    margin-bottom: 14px;
    font-size: 18px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .auth-main {
        width: calc(100% - 20px);
        margin-top: 18px;
    }

    .auth-card {
        padding: 20px 16px;
    }

    .auth-criteria ul {
        grid-template-columns: 1fr;
    }
}
