/* ============================================================
   auth.css — pages /connexion et /inscription
   Layout sobre : header logo, carte centrée, footer minimal.
   ============================================================ */

.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
}

.auth-header {
    padding: 24px 32px;
}
.auth-brand img {
    height: 32px;
    width: auto;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-footer {
    padding: 20px 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.auth-footer a {
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.auth-footer a:hover {
    color: var(--text);
}

/* === Carte centrale === */
.auth-card {
    width: 100%;
    max-width: 550px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px 32px;
}
.auth-card h1 {
    margin: 0 0 4px;
    font-size: 28px;
    color: var(--text);
}

/* Séparateur ceintures sous le titre — 5 segments arrondis (signature Beltprogress).
   Usage : <div class="title-accent" aria-hidden><span></span>×5</div> */
.title-accent {
    display: flex;
    gap: 8px;
    width: 100%;
    margin: 8px 0 24px;
}
.title-accent > span {
    flex: 1;
    height: 3px;
    border-radius: 999px;
}
.title-accent > span:nth-child(1) {
    background: var(--belt-yellow);
}
.title-accent > span:nth-child(2) {
    background: var(--belt-orange);
}
.title-accent > span:nth-child(3) {
    background: var(--belt-red);
}
.title-accent > span:nth-child(4) {
    background: var(--belt-green);
}
.title-accent > span:nth-child(5) {
    background: var(--belt-blue);
}

.auth-card p.lead {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 15px;
}

/* === Form fields === */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.form-field label {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}
.form-field input[type='text'],
.form-field input[type='email'],
.form-field input[type='password'] {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.form-field input:focus {
    outline: none;
    border-color: var(--belt-yellow);
    box-shadow: 0 0 0 3px rgba(252, 192, 43, 0.15);
}
.form-field .hint {
    font-size: 12px;
    color: var(--text-soft);
}
/* Règles du mot de passe (cochées en tapant) et jauge de robustesse — cf. auth.js. */
.password-help {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.password-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--text-muted);
}
.password-rules li::before {
    content: '○';
    display: inline-block;
    width: 1.2em;
    color: var(--text-soft);
}
.password-rules li.met {
    color: var(--belt-green);
}
.password-rules li.met::before {
    content: '✓';
    color: var(--belt-green);
}
.password-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-soft);
}
.password-meter-bar {
    display: flex;
    gap: 4px;
    width: 110px;
    flex-shrink: 0;
}
.password-meter-bar span {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: var(--border);
    transition: background 0.2s;
}
.password-meter[data-strength='1'] .password-meter-bar span:nth-child(-n + 1) { background: var(--belt-red); }
.password-meter[data-strength='2'] .password-meter-bar span:nth-child(-n + 2) { background: var(--belt-orange); }
.password-meter[data-strength='3'] .password-meter-bar span:nth-child(-n + 3) { background: var(--belt-green); }
.password-meter[data-strength='4'] .password-meter-bar span { background: var(--belt-green); }
.password-meter[data-strength='1'] .password-meter-label { color: var(--belt-dark-red); }
.password-meter[data-strength='4'] .password-meter-label { color: var(--belt-green); }

.form-field .field-error {
    color: var(--belt-red);
    font-size: 13px;
    min-height: 1em;
}

/* Lien "Mot de passe oublié ?" — placé sous l'input mdp dans la form-field */
.form-field .forgot-link {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    align-self: flex-end;
}
.form-field .forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* === Inscription : ce qui suit l'essai, sous le bouton ===
   Les conditions d'utilisation passent dessous, séparées d'un pointillé. */
.after-note {
    margin: 12px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}
.after-note + .auth-terms {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-soft);
    font-size: 12.5px;
}

/* === Bouton Google Sign-In === */

.google-signin {
    display: flex;
    justify-content: center;
    margin: 0 0 4px;
}

.google-signin-error {
    color: var(--belt-red);
    font-size: 13px;
    min-height: 1em;
}
.google-signin-error:empty {
    min-height: 0;
}

/* Séparateur "ou" entre Google et le form */
.auth-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-separator span {
    text-transform: lowercase;
}

/* === Submit + Erreur globale === */
.form-submit {
    width: 100%;
    margin-top: 8px;
    justify-content: center;
}
.form-submit[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-error-banner {
    background: rgba(236, 99, 103, 0.08);
    border: 1px solid var(--belt-red);
    color: var(--belt-dark-red);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    /* Préserve les \n du detail comme retours à la ligne (collapse les autres espaces). */
    white-space: pre-line;
    display: none;
}
.form-error-banner.is-visible {
    display: block;
}

.form-success-banner {
    background: rgba(110, 170, 61, 0.08);
    border: 1px solid var(--belt-green);
    color: #3f6925;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

/* === Footer du formulaire (lien vers l'autre page) === */
.auth-switch {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-switch a:hover {
    text-decoration: underline;
}

/* Acceptation des conditions, sous le bouton d'inscription */
.auth-terms {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}
.auth-terms a {
    color: var(--text-muted);
    text-underline-offset: 3px;
}
.auth-terms a:hover {
    color: var(--text);
}
