/* =================================================================
   auth.css — Styles de la page de connexion / authentification
   Préfixe : auth- / pwd-
   ================================================================= */

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

/* Layout principal */
.auth-split {
    display: flex;
    height: 100vh;
    width: 100%;
    background: #fff;
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

.auth-left {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow-y: auto;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

/* Logo */
.auth-logo img {
    width: 140px;
    height: auto;
    margin-bottom: 36px;
    display: block;
}

/* Titres */
.auth-title {
    color: #000;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.2;
}

.auth-subtitle {
    color: #717171;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* Alertes flash */
.auth-alert {
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 22px;
}
.auth-alert--info    { background: #e8f4fd; color: #1a6fa8; border-left: 4px solid #4ba2dd; }
.auth-alert--success { background: #eafaf1; color: #1a7a42; border-left: 4px solid #27ae60; }
.auth-alert--error   { background: #fdf0f0; color: #a02020; border-left: 4px solid #e74c3c; }

/* Champs */
.auth-field { margin-bottom: 18px; }
.auth-field input {
    width: 100%;
    padding: 15px 20px;
    background: #f4f7f9;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s, background 0.25s;
    color: #222;
    -webkit-appearance: none;
    appearance: none;
    min-height: 52px; /* touch target iOS */
}
.auth-field input:focus {
    border-color: #4ba2dd;
    background: #fff;
}

/* Lien mot de passe oublié */
.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #4ba2dd;
    text-decoration: none;
    margin-top: -8px;
    margin-bottom: 22px;
}
.forgot-link:hover { text-decoration: underline; }

/* Bouton principal */
.auth-btn {
    width: 100%;
    padding: 15px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s, transform 0.2s;
    margin-bottom: 20px;
    min-height: 52px; /* touch target */
    touch-action: manipulation;
}
.auth-btn:hover  { background: #36adde; transform: translateY(-2px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { background: #999; cursor: not-allowed; transform: none; }

/* Lien retour */
.auth-back { text-align: center; }
.auth-back a {
    color: #4ba2dd;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.auth-back a:hover { text-decoration: underline; }

/* Copyright — flux normal, pas de position:absolute */
.auth-copyright {
    margin-top: 32px;
    text-align: center;
    font-size: 11px;
    color: #bbb;
}

/* Panneau droit */
.auth-right {
    flex: 1;
    background: url('../images/bg.jpg') no-repeat center center;
    background-size: cover;
    margin: 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-glass {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 20px;
    width: 65%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.auth-glass h3 {
    color: #fff;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 14px;
    line-height: 1.3;
}
.auth-glass p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.6;
}

/* Toggle visibilité mot de passe */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 52px; }
.pwd-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    padding: 0;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.pwd-toggle:hover { color: #4ba2dd; }

/* Indicateurs règles mot de passe */
.pwd-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.pwd-rule {
    font-size: 11px;
    color: #bbb;
    background: #f4f7f9;
    padding: 3px 8px;
    border-radius: 20px;
    transition: color 0.2s, background 0.2s;
}
.pwd-rule.ok, .rule.ok {
    color: #27ae60;
    background: #eafaf1;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablettes (≤ 900px) : masquer le panneau droit */
@media (max-width: 900px) {
    .auth-right { display: none; }
    .auth-left  { flex: 1; padding: 40px 36px; }
}

/* Petites tablettes / grands téléphones (≤ 640px) */
@media (max-width: 640px) {
    .auth-split { height: auto; min-height: 100svh; }
    .auth-left  {
        padding: 32px 24px;
        align-items: flex-start;
    }
    .auth-form-wrap { padding-top: 8px; }
    .auth-logo img  { width: 120px; margin-bottom: 28px; }
    .auth-title     { font-size: 24px; }
    .auth-subtitle  { font-size: 13px; margin-bottom: 22px; }
    /* font-size 16px évite le zoom automatique sur iOS */
    .auth-field input { font-size: 16px; padding: 14px 16px; }
    .auth-btn         { font-size: 16px; }
    .auth-glass       { width: 88%; padding: 28px 24px; }
}

/* Petits téléphones (≤ 400px) */
@media (max-width: 400px) {
    .auth-left { padding: 24px 16px; }
    .auth-title { font-size: 22px; }
    .auth-subtitle { font-size: 12px; }
}
