/* ==========================================================================
   MODULE AUTH — MIRE DE CONNEXION & AUTHENTIFICATION COCKPIT (MODE CLAIR)
   ========================================================================== */

.auth-body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-app, #fafafa);
    color: var(--text-main, #323a45);
    font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif);
    -webkit-font-smoothing: antialiased;
}

.auth-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    box-sizing: border-box;
    background:
        radial-gradient(circle at 50% 0%, rgba(41, 61, 98, 0.07) 0%, rgba(41, 61, 98, 0) 60%),
        linear-gradient(180deg, #f4f6f7 0%, #fafafa 100%);
}

.auth-shell {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.auth-sandbox-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: var(--radius-md, 8px);
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 1px 2px rgba(180, 83, 9, 0.06);
}

.auth-sandbox-pill svg {
    flex-shrink: 0;
    color: #d97706;
}

.auth-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e1e4e9);
    border-radius: var(--radius-lg, 12px);
    padding: 28px 26px 26px;
    width: 100%;
    box-sizing: border-box;
    box-shadow:
        0 12px 28px -6px rgba(41, 61, 98, 0.08),
        0 2px 6px -1px rgba(15, 23, 42, 0.04);
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle, #e1e4e9);
}

.auth-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    max-width: 100%;
}

.auth-logo-img {
    max-height: 38px;
    max-width: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.auth-logo-img.is-square {
    max-height: 36px;
    border-radius: var(--radius-sm, 6px);
}

.auth-brand-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
    border-radius: var(--radius-md, 8px);
    flex-shrink: 0;
}

.auth-brand-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main, #323a45);
    letter-spacing: -0.02em;
}

.auth-badge-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-cockpit-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-full, 9999px);
    background: var(--brand-light, #f4f6f7);
    border: 1px solid var(--border-color, #e1e4e9);
    color: var(--brand-primary, #293d62);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-main, #323a45);
    margin: 0;
    line-height: 1.3;
}

.auth-subtitle {
    font-size: 11.5px;
    color: var(--text-muted, #7a88a2);
    margin: 4px 0 0;
    line-height: 1.4;
}

.auth-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

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

.auth-form .form-group {
    margin-bottom: 14px;
}

.auth-form .cockpit-input-group .form-control {
    height: 36px;
    min-height: 36px;
}

.auth-remember-wrap {
    margin-top: 2px;
    margin-bottom: 18px;
    padding: 8px 10px;
    background: var(--bg-surface, #f4f6f7);
    border: 1px solid var(--border-subtle, #e1e4e9);
    border-radius: var(--radius-sm, 6px);
}

.auth-submit-wrap .auth-submit-btn {
    height: 38px;
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    width: 100%;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 4px;
    font-size: 11px;
    color: var(--text-muted, #7a88a2);
    flex-wrap: wrap;
}

.auth-footer-security {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.auth-footer-security svg {
    color: var(--status-success, #2a9308);
    flex-shrink: 0;
}

.auth-footer-copy {
    color: var(--text-dim, #9aa5b8);
}

/* ==========================================================================
   RESPONSIVE MOBILE & TABLETTE (MIRE D'AUTHENTIFICATION)
   ========================================================================== */

@media (max-width: 640px) {
    .auth-wrapper {
        padding: 16px 14px;
        justify-content: center;
    }

    .auth-shell {
        max-width: 100%;
    }

    .auth-card {
        padding: 22px 18px 20px;
        border-radius: var(--radius-md, 10px);
    }

    .auth-header {
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .auth-logo-img {
        max-height: 34px;
        max-width: 175px;
    }

    /* Évite le zoom automatique iOS Safari au focus des champs */
    .auth-form .form-control {
        font-size: 16px;
        height: 40px;
        min-height: 40px;
    }

    .auth-submit-wrap .auth-submit-btn {
        height: 42px;
        font-size: 13.5px;
    }

    .auth-footer {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 4px;
    }
}

@media (max-width: 360px) {
    .auth-wrapper {
        padding: 12px 10px;
    }

    .auth-card {
        padding: 18px 14px 16px;
    }

    .auth-remember-wrap {
        padding: 7px 8px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .auth-wrapper {
        justify-content: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }
}
