/**
 * css/auth.css
 * Formulaires d'authentification — charte "C — Ardoise", la même que le
 * reste du cahier journal (rail sombre, accent ocre/corail, Bricolage
 * Grotesque + Hanken Grotesk). Les noms de classes sont conservés à
 * l'identique : seul l'habillage change, aucune page auth/*.php à toucher.
 */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bleu:    #3b6fb0;   --bleu-d:  #1f2530;
    --vert:    #4e8a5b;   --jaune:   #e8a13c;
    --corail:  #c2553c;   --violet:  #8268a8;
    --creme:   #f6f6f3;   --encre:   #23262e;
    --gris:    #9aa0a8;   --ombre:   rgba(31,37,48,.08);
    --rail:    #1f2530;   --bord:    #e3e3df;
    /* alias historiques, gardés pour compatibilité avec d'anciennes règles */
    --gris-l:  #f3f4f6;   --blanc:   #ffffff;   --border: var(--bord);
}

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

html, body {
    font-family: 'Hanken Grotesk', sans-serif;
    background: var(--creme);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--encre);
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--bord);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(31, 37, 48, .10);
    padding: 36px 34px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--corail), var(--jaune));
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rail);
    letter-spacing: -.3px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-header h1::before {
    content: "C";
    display: grid; place-items: center; flex: none;
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--jaune); color: var(--rail);
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1rem;
}

.auth-header p {
    font-size: .88rem;
    color: var(--gris);
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--rail);
    font-size: .85rem;
}

.form-group input,
.form-group select {
    padding: 11px 13px;
    border: 1px solid var(--bord);
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    color: var(--encre);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--bleu);
    box-shadow: 0 0 0 3px rgba(59, 111, 176, .15);
}

.form-group input::placeholder {
    color: #c4c8cc;
}

/* --- Boutons --- */
.btn {
    display: inline-block;
    padding: 11px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 1px 2px var(--ombre);
    transition: transform .12s, box-shadow .12s, background .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--ombre); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--rail);
    color: #fff;
    width: 100%;
}
.btn-primary:hover { background: var(--rail); filter: brightness(1.25); }
.btn-primary:active { filter: brightness(1.1); }

.btn-secondary {
    background: #fff;
    color: var(--encre);
    border: 1px solid var(--bord);
    box-shadow: none;
    width: 100%;
}
.btn-secondary:hover { background: var(--creme); filter: none; box-shadow: none; }

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
    filter: none !important;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--gris);
    font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--bord);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 22px;
    font-size: .85rem;
}
.auth-links a {
    color: var(--bleu);
    text-decoration: none;
    font-weight: 600;
}
.auth-links a:hover { color: var(--corail); text-decoration: underline; }

.auth-footer {
    text-align: center;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--bord);
    font-size: .78rem;
    color: var(--gris);
}
.auth-footer a { color: var(--gris); text-decoration: underline; }
.auth-footer a:hover { color: var(--corail); }

/* --- Messages --- */
.alert {
    padding: 11px 14px 11px 40px;
    border-radius: 10px;
    font-size: .85rem;
    margin-bottom: 18px;
    position: relative;
    line-height: 1.5;
}
.alert::before {
    position: absolute; left: 14px; top: 11px;
    font-size: 1rem; line-height: 1;
}
.alert a { color: inherit; font-weight: 700; text-decoration: underline; }

.alert-error {
    background: #fdf0ee; border: 1px solid #f3d2c8; color: #8a3a24;
}
.alert-error::before { content: "⚠"; }

.alert-success {
    background: #eef4ef; border: 1px solid #cfe0d3; color: #375d3f;
}
.alert-success::before { content: "✓"; }

.alert-info {
    background: #eef3f9; border: 1px solid #cddaeb; color: #2c4a6e;
}
.alert-info::before { content: "ℹ"; }

.alert-warning {
    background: #fdf6ea; border: 1px solid #f1dfb8; color: #8a6416;
}
.alert-warning::before { content: "⚠"; }

/* --- Indicateur de force du mot de passe --- */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.password-strength span {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--bord);
    transition: background .2s;
}
.password-strength.weak span:nth-child(1) { background: var(--corail); }
.password-strength.medium span:nth-child(1),
.password-strength.medium span:nth-child(2) { background: var(--jaune); }
.password-strength.strong span { background: var(--vert); }

/* --- Chargement --- */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
