/* =====================================================
   BULNKE — PAGES D'AUTHENTIFICATION
   Connexion personnel, espace élève, changement de mot de passe.
   Reprend les couleurs et polices de app.css.
   ===================================================== */

@import url('police.css');

:root {
    --primary:     #0A7B5C;
    --primary-dk:  #064E3B;
    --primary-dkr: #053A2B;
    --primary-lt:  #E2F3EC;
    --red:         #E5173F;
    --red-lt:      #FDEAEE;
    --gold:        #E3A32A;
    --gold-lt:     #FEF6E9;
    --dark:        #0F2A22;
    --mid:         #4A5E56;
    --light:       #5E6F67;
    --border:      #DAE5DF;
    --bg:          #F0F5F2;
    --white:       #FFFFFF;
    --radius-sm:   8px;
    --radius:      14px;
    --font-display: 'Philosopher', Georgia, 'Times New Roman', serif;
    --font-body:    'Philosopher', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--dark);
    background: var(--bg);
    min-height: 100vh;
}

/* ── Mise en page : panneau de marque + formulaire ── */
.auth {
    display: grid;
    grid-template-columns: minmax(380px, 5fr) 7fr;
    min-height: 100vh;
}
.auth > * { min-width: 0; }

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 48px 52px;
    color: var(--white);
    background:
        radial-gradient(circle at 85% 10%, rgba(255,255,255,.08) 0, transparent 40%),
        linear-gradient(160deg, #0A5C47 0%, #0A4A4F 55%, #08333B 100%);
}
.auth-brand::after {             /* motif discret */
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.brand-id { display: flex; align-items: center; gap: 14px; }
.brand-logo {
    width: 56px; height: 56px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--white);
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.brand-logo span {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--primary-dk);
}
.brand-name { font-weight: 700; font-size: 1rem; line-height: 1.3; text-transform: uppercase; letter-spacing: .02em; }
.brand-place { font-size: .82rem; opacity: .7; margin-top: 2px; }

.brand-pitch h1 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.01em;
}
.brand-pitch h1 em { font-style: normal; color: var(--gold); }
.brand-pitch p { margin-top: 14px; max-width: 34ch; line-height: 1.6; opacity: .78; font-size: .95rem; }

.brand-features { list-style: none; display: grid; gap: 14px; margin-top: 30px; }
.brand-features li { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.brand-features .ico {
    width: 34px; height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    display: grid;
    place-items: center;
}
.brand-features svg { width: 17px; height: 17px; }

.brand-foot { font-size: .78rem; opacity: .55; }

/* ── Colonne du formulaire ── */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--white);
}
.auth-card { width: 100%; max-width: 400px; }

.auth-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--primary-lt);
    color: var(--primary-dk);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.auth-tag.warn { background: var(--gold-lt); color: #8A5A00; }
.auth-tag svg { width: 13px; height: 13px; }

.auth-card h2 {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 800;
    margin-top: 16px;
    letter-spacing: -.01em;
}
.auth-card .lead { color: var(--mid); font-size: .92rem; line-height: 1.55; margin-top: 6px; margin-bottom: 28px; }

/* ── Alertes ── */
.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: .86rem;
    line-height: 1.45;
    margin-bottom: 20px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--red-lt);     color: #9B0F2B; border: 1px solid #F7C2CD; }
.alert-info    { background: var(--primary-lt); color: var(--primary-dk); border: 1px solid #B9E4CF; }

/* ── Champs ── */
.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--mid);
    letter-spacing: .03em;
    margin-bottom: 7px;
}
.control { position: relative; }
.control > svg {
    position: absolute;
    left: 14px; top: 50%;
    width: 18px; height: 18px;
    transform: translateY(-50%);
    color: var(--light);
    pointer-events: none;
    transition: color .2s;
}
.control input {
    width: 100%;
    height: 48px;
    padding: 0 46px 0 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--dark);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
}
.control input::placeholder { color: var(--light); }
.control input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10,123,92,.12);
}
.control:focus-within > svg { color: var(--primary); }
.field.has-error .control input { border-color: var(--red); }

.toggle-pwd {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--light);
    cursor: pointer;
}
.toggle-pwd:hover { color: var(--mid); background: var(--bg); }
.toggle-pwd:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.toggle-pwd svg { width: 18px; height: 18px; }
.toggle-pwd .eye-off { display: none; }
.toggle-pwd[aria-pressed="true"] .eye-on  { display: none; }
.toggle-pwd[aria-pressed="true"] .eye-off { display: block; }

.hint { font-size: .78rem; color: var(--light); margin-top: 6px; }
.caps { font-size: .78rem; color: #8A5A00; margin-top: 6px; }

/* ── Indicateur de robustesse ── */
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.strength span { height: 4px; border-radius: 2px; background: var(--border); transition: background .25s; }
.strength-label { font-size: .76rem; color: var(--light); margin-top: 6px; }

.rules {
    list-style: none;
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: .8rem;
    color: var(--mid);
}
.rules li { display: flex; align-items: center; gap: 8px; }
.rules li::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--light);
    flex-shrink: 0;
}
.rules li.ok { color: var(--primary-dk); }
.rules li.ok::before { background: var(--primary); }

/* ── Bouton ── */
.btn-submit {
    width: 100%;
    height: 50px;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--white);
    font-family: var(--font-body);
    font-size: .98rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(10,123,92,.3);
    transition: background .2s, transform .15s, box-shadow .2s;
}
.btn-submit:hover { background: var(--primary-dk); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(10,123,92,.32); }
.btn-submit:active { transform: none; }
.btn-submit:focus-visible { outline: 3px solid rgba(10,123,92,.35); outline-offset: 2px; }
.btn-submit svg { width: 18px; height: 18px; }
.btn-submit[disabled] { opacity: .7; cursor: progress; transform: none; }

/* ── Bas de carte ── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 18px;
    color: var(--light);
    font-size: .78rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.alt-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--dark);
    text-decoration: none;
    transition: border-color .2s, background .2s;
}
.alt-link:hover { border-color: var(--primary); background: var(--primary-lt); }
.alt-link .ico {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--primary-lt);
    color: var(--primary);
    display: grid;
    place-items: center;
}
.alt-link .ico svg { width: 20px; height: 20px; }
.alt-link strong { display: block; font-size: .9rem; }
.alt-link small { color: var(--mid); font-size: .8rem; }
.alt-link .arrow { margin-left: auto; color: var(--light); width: 18px; height: 18px; }

.auth-legal { margin-top: 28px; text-align: center; font-size: .76rem; color: var(--light); }
.auth-legal a { color: var(--mid); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { padding: 28px 24px; gap: 0; }
    .brand-pitch, .brand-foot { display: none; }
    .auth-main { padding: 32px 20px 40px; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
