/* ==========================================================
   Thème AJV – Webmail  (polices, page de connexion, logo)
   Les couleurs générales sont dans couleurs.css
   ========================================================== */

/* ---------- Polices Barlow (hébergées localement, RGPD) ---------- */
@font-face{font-family:'Barlow';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/barlow-latin-400-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/barlow-latin-500-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/barlow-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow Semi Condensed';font-style:normal;font-weight:600;font-display:swap;src:url(fonts/barlow-semi-condensed-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow Semi Condensed';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/barlow-semi-condensed-latin-700-normal.woff2) format('woff2')}

body, button, input, optgroup, select, textarea, .popover {
    font-family: 'Barlow', 'Roboto', sans-serif;
}
body { font-size: 0.95rem; }

/* Titres : sujet du message, en-têtes de colonnes, boîtes de dialogue */
#message-header > .subject,
#layout > div > .header .header-title,
.ui-dialog-title,
.formcontent legend, fieldset > legend,
.boxtitle, .sidebar-title {
    font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif;
    font-weight: 700;
    letter-spacing: .01em;
}
#layout > div > .header .header-title { color: #0f1e2e; }
html.dark-mode #layout > div > .header .header-title { color: inherit; }

/* Coins arrondis façon site (boutons) */
.btn, .floating-action-buttons a.button { border-radius: 8px; }

/* ---------- Menu latéral (bleu du logo) ---------- */
#layout-menu #logo {
    width: 64px;
    max-width: 80%;
    height: auto;
    max-height: none;
    margin: .9rem auto .7rem;
}
#taskmenu a.compose,
#taskmenu a.compose:hover { border-radius: 10px; margin: .25rem .4rem; }

/* ---------- Page de connexion ---------- */
body.task-login {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 160' preserveAspectRatio='none'%3E%3Cpath fill='%230b5d8f' d='M0 70c120-30 240-46 360-36s240 52 360 52 240-42 360-52 240 6 360 36v90H0z'/%3E%3Cpath fill='%2304255a' d='M0 112c160-26 320-34 480-20s320 38 480 38 320-22 480-38v68H0z'/%3E%3C/svg%3E") no-repeat center bottom / 100% 120px,
        linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%) fixed;
    min-height: 100vh;
}
.task-login #layout-content { background: transparent; }

.task-login #logo {
    top: 9vh;
    max-height: none;
    width: 400px;
    max-width: 86vw;
    height: auto;
}

#login-form {
    top: 13vh;
    max-width: 380px;
    padding: 1.6rem 1.8rem 1.4rem;
    background: #fff;
    border: 1px solid #e3e9ef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15,30,46,.06), 0 8px 24px rgba(15,30,46,.08);
    text-align: left;
}
#login-form::before {
    content: "Messagerie de l'association";
    display: block;
    margin: 0 0 1.1rem;
    font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 1.45rem;
    color: #0f1e2e;
    text-align: center;
}
#login-form::after {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    width: 64px; height: 4px;
    margin-left: -32px;
    border-radius: 0 0 4px 4px;
    background: #c4471f;
}
#login-form .input-group,
#login-form input.form-control { border-radius: 8px; }

#rcmloginsubmit {
    margin-top: .4rem;
    padding: .65rem 1rem;
    border: 0;
    border-radius: 8px;
    background: #c4471f;
    font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
#rcmloginsubmit:hover,
#rcmloginsubmit:focus,
#rcmloginsubmit:not([disabled]):not(.disabled):active {
    background: #a83a17;
    box-shadow: 0 0 0 .2rem rgba(196,71,31,.25);
}

#login-footer {
    margin-top: 1.2rem;
    padding-top: .9rem;
    border-top: 1px solid #e3e9ef;
    color: #8a96a3;
    font-size: .8rem;
    text-align: center;
}
#login-footer a.ajv-retour {
    display: block;
    margin-bottom: .3rem;
    color: #0b5d8f;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
}
#login-footer a.ajv-retour:hover { color: #c4471f; }

/* Mode sombre */
html.dark-mode body.task-login {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 160' preserveAspectRatio='none'%3E%3Cpath fill='%230b5d8f' d='M0 70c120-30 240-46 360-36s240 52 360 52 240-42 360-52 240 6 360 36v90H0z'/%3E%3Cpath fill='%2304255a' d='M0 112c160-26 320-34 480-20s320 38 480 38 320-22 480-38v68H0z'/%3E%3C/svg%3E") no-repeat center bottom / 100% 120px,
        #21292c;
}
html.dark-mode #login-form { background: #2c373a; border-color: #374549; }
html.dark-mode #login-form::before { color: #fff; }
html.dark-mode #login-footer { color: #8b9fa7; border-color: #374549; }
html.dark-mode #login-footer a.ajv-retour { color: #7fc4ec; }

/* Liens lisibles sur fond sombre (spécificité minimale : n'écrase rien d'autre) */
:where(html.dark-mode) a { color: #7fc4ec; }
:where(html.dark-mode) a:hover { color: #f08a63; }
html.dark-mode #taskmenu .action-buttons a,
html.dark-mode #taskmenu .action-buttons a:hover { color: #fff; }

/* Petits écrans */
@media screen and (max-width: 480px) {
    .task-login #logo { top: 4vh; width: 300px; }
    #login-form { top: 7vh; padding: 1.2rem 1.1rem 1rem; }
    body.task-login { background-size: 100% 70px, auto; }
}

/* En-tête du menu sur téléphone */
#layout-menu .popover-header { background-color: #04255a !important; }
#layout-menu .popover-header #logo { width: 56px; margin: .3rem 0; }
