/* ============================================
   PAGES DE CONNEXION / INSCRIPTION
   ============================================ */

.auth-body {
    margin: 0;
    padding-top: 0 !important; /* main.css réserve la place de la barre du site */
    min-height: 100vh;
    background: var(--bg-white);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    min-height: 100vh;
}

/* Panneau de marque */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    color: #fff;
    background: linear-gradient(150deg, #9462e3 0%, #663da7 55%, #4c2e7e 100%);
}

.auth-aside::before,
.auth-aside::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
}
.auth-aside::before { width: 30rem; height: 30rem; top: -10rem; right: -12rem; }
.auth-aside::after { width: 22rem; height: 22rem; bottom: -9rem; left: -8rem; }

.auth-aside > * { position: relative; z-index: 1; }
.auth-aside-logo img { height: 34px; }

.auth-aside-content h2 {
    font-size: clamp(1.8rem, 2.6vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    max-width: 26rem;
}

.auth-aside-content ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.auth-aside-content li { display: flex; align-items: center; gap: 0.7rem; font-size: 1.02rem; opacity: 0.95; }
.auth-aside-content li i {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-grid;
    place-items: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.auth-aside-card {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: #fff;
    color: #17131f;
    box-shadow: 0 18px 40px rgba(20, 5, 45, 0.3);
    min-width: 18rem;
}
.auth-aside-card-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.7rem;
    background: #22c55e;
    color: #fff;
    display: grid;
    place-items: center;
}
.auth-aside-card strong { display: block; font-size: 0.9rem; }
.auth-aside-card span { font-size: 0.78rem; color: #6b6280; }
.auth-aside-card-amount { margin-left: auto; font-weight: 800; color: #16a34a !important; font-size: 1rem !important; }

/* Formulaire */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.auth-panel { width: 100%; max-width: 400px; }
.auth-panel.is-wide { max-width: 520px; }

.auth-logo { display: none; margin-bottom: 2rem; }
.auth-logo img { height: 30px; }

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.auth-subtitle { color: var(--text-muted); margin: 0 0 1.75rem; }

.auth-alert {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}
.auth-alert i { margin-top: 0.15rem; }
.auth-alert-error { background: #fde8e8; color: #9b1c1c; }
.auth-alert-success { background: #e3f6ec; color: #166534; }

.auth-form { margin-bottom: 0; }
.auth-field { margin-bottom: 1.1rem; }
.auth-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }

.auth-form .form-label { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.4rem; color: var(--text-primary); }

.auth-form .form-control {
    padding: 0.7rem 0.9rem;
    border-radius: 0.7rem;
    border: 1px solid var(--border-color);
    font-size: 0.98rem;
}
.auth-form .form-control:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(148, 98, 227, 0.2);
}

.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-link-sm { font-size: 0.83rem; font-weight: 600; text-decoration: none; color: var(--primary-600); }

.password-field { position: relative; }
.password-field .form-control { padding-right: 2.9rem; }
.password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 0.5rem;
}
.password-toggle:hover { color: var(--primary-600); }

.auth-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }

.auth-form .btn-lg,
.auth-panel .btn-lg { border-radius: 0.75rem; font-weight: 700; padding: 0.8rem 1rem; font-size: 1rem; }

.auth-panel .btn-light {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.auth-panel .btn-light:hover { border-color: var(--primary-400); }

.auth-legal { font-size: 0.78rem; color: var(--text-muted); margin: 1rem 0 0; text-align: center; line-height: 1.5; }
.auth-legal a { color: inherit; }

.auth-switch { text-align: center; margin: 1.5rem 0 0; color: var(--text-muted); font-size: 0.93rem; }
.auth-switch a { font-weight: 700; text-decoration: none; color: var(--primary-600); }

.auth-text { color: var(--text-muted); margin-bottom: 1.25rem; }

.auth-status { text-align: center; margin-bottom: 1.25rem; }
.auth-status p { color: var(--text-secondary, #4a4458); margin: 0 0 0.5rem; }
.auth-status-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
}
.auth-status-icon.is-success { background: #e3f6ec; color: #16a34a; }
.auth-status-icon.is-error { background: #fde8e8; color: #dc2626; }
.auth-status-icon.is-warning { background: #fff4dc; color: #b45309; }
.auth-status-icon.is-brand { background: #f1eafc; color: #7f4ccf; }

.auth-tips {
    list-style: none;
    padding: 0.9rem 1rem;
    margin: 0 0 1.25rem;
    border-radius: 0.75rem;
    background: var(--bg-light);
    display: grid;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.auth-tips li { display: flex; gap: 0.6rem; align-items: baseline; }
.auth-tips i { color: var(--primary-500); }

.auth-footer { margin-top: 2rem; text-align: center; font-size: 0.85rem; }
.auth-footer a { color: var(--text-muted); text-decoration: none; }
.auth-footer a:hover { color: var(--primary-600); }

[data-theme="dark"] .auth-alert-error { background: rgba(220, 38, 38, 0.15); color: #fca5a5; }
[data-theme="dark"] .auth-alert-success { background: rgba(34, 197, 94, 0.15); color: #86efac; }

@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); }
    .auth-aside { display: none; }
    .auth-logo { display: inline-block; }
    .auth-main { align-items: flex-start; padding-top: 2rem; }
}

@media (max-width: 420px) {
    .auth-field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .auth-title { font-size: 1.5rem; }
}
