/* ============================================================
   InnoWeb IDP — Styles des pages d'authentification
   ============================================================ */

:root {
    --color-primary: #4F46E5;
    --color-bg: #F9FAFB;
    --color-surface: #FFFFFF;
    --color-border: #E5E7EB;
    --color-text: #111827;
    --color-text-muted: #6B7280;
    --color-error-bg: #FEF2F2;
    --color-error-border: #FECACA;
    --color-error-text: #B91C1C;
    --color-success-bg: #F0FDF4;
    --color-success-border: #BBF7D0;
    --color-success-text: #166534;
    --color-info-bg: #EFF6FF;
    --color-info-border: #BFDBFE;
    --color-info-text: #1D4ED8;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

/* --- Reset minimal --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
}

/* --- Mise en page 2 colonnes (illustration + formulaire) --- */
.auth-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-illustration {
    flex: 1 1 50%;
    position: relative;
    background-image: url('/img/auth-illustration.svg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 48px;
    overflow: hidden;
}
.auth-illustration-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, color-mix(in oklab, var(--color-primary) 85%, transparent), color-mix(in oklab, #0f172a 85%, transparent));
    z-index: 1;
}
.auth-illustration-text {
    position: relative;
    z-index: 2;
    color: #fff;
}
.auth-illustration-text h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
}
.auth-illustration-text p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .9);
}

.auth-form-side {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

/* Sur la mise en page 2 colonnes, le formulaire est posé directement sur le
   panneau (comme la référence) : on neutralise le style "carte" flottante. */
.auth-form-side .card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

@media (max-width: 1024px) {
    .auth-illustration {
        display: none;
    }
    .auth-form-side {
        flex: 1 1 100%;
        width: 100%;
    }
    /* En repli mono-colonne, on retrouve la carte centrée d'origine. */
    .auth-form-side .card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 32px;
    }
}

/* --- Conteneur de page --- */
.page-wrapper {
    width: 100%;
    max-width: 400px;
}

/* --- Entête branding --- */
.brand-header {
    text-align: center;
    margin-bottom: 28px;
}
.brand-header img { height: 48px; }
.brand-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
}
.brand-company {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: block;
    margin-top: 2px;
}
.brand-caption {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    display: block;
    margin-top: 8px;
}

/* --- Carte --- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

/* --- Typographie --- */
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}
.page-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

/* --- Alertes --- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-error {
    background: var(--color-error-bg);
    border-color: var(--color-error-border);
    color: var(--color-error-text);
}
.alert-success {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
}
.alert-info {
    background: var(--color-info-bg);
    border-color: var(--color-info-border);
    color: var(--color-info-text);
}
.alert p + p { margin-top: 4px; }
.alert-title { font-weight: 600; margin-bottom: 4px; }

/* --- Formulaire --- */
.form-group { margin-bottom: 16px; }
.form-group-last { margin-bottom: 24px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}
.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.form-control-code {
    text-align: center;
    font-size: 24px;
    font-family: monospace;
    letter-spacing: .5em;
    padding: 10px 12px;
}

.field-error {
    display: block;
    font-size: 12px;
    color: var(--color-error-text);
    margin-top: 4px;
}

/* --- Boutons --- */
.btn {
    display: inline-block;
    width: 100%;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover { background: color-mix(in oklab, var(--color-primary) 80%, black); }

/* --- Liens --- */
.link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 13px;
}
.link:hover { text-decoration: underline; }

/* --- Utilitaires --- */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.request-id {
    text-align: center;
    margin-top: 16px;
    font-size: 11px;
    color: var(--color-text-muted);
}
.error-icon { font-size: 48px; text-align: center; margin-bottom: 16px; }
