/* Version + copyright (Green Code Iraq) — rempli par mip-branding.js */
[data-mip-branding] {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    text-align: start;
    line-height: 1.45;
    margin: 0;
    padding-top: 0.65rem;
    margin-top: 0.65rem;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}

.mip-branding--sidebar {
    flex-shrink: 0;
}

/* App main — coin bas opposé à la sidebar (RTL: gauche, LTR: droite) */
body.mip-main-app .mip-main-branding-corner {
    position: fixed;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    inset-inline-end: max(14px, env(safe-area-inset-right, 0px));
    z-index: 40;
    margin: 0;
    padding: 6px 12px;
    border-top: none;
    border-radius: 10px;
    font-size: 0.7rem;
    line-height: 1.35;
    color: var(--text-muted, #64748b);
    background: color-mix(in srgb, var(--surface-solid, #fff) 88%, transparent);
    border: 1px solid rgba(100, 116, 139, 0.18);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    pointer-events: none;
    user-select: none;
    max-width: min(420px, calc(100vw - var(--sidebar-width, 297px) - 28px));
    text-align: end;
}

[dir="ltr"] body.mip-main-app .mip-main-branding-corner {
    inset-inline-end: max(14px, env(safe-area-inset-right, 0px));
}

[data-theme="dark"] body.mip-main-app .mip-main-branding-corner {
    color: #94a3b8;
    background: color-mix(in srgb, #0f172a 92%, transparent);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

@media (max-width: 900px) {
    body.mip-main-app .mip-main-branding-corner {
        max-width: calc(100vw - 28px);
        font-size: 0.65rem;
        padding: 5px 10px;
    }
}

.sidebar-footer .mip-branding--sidebar {
    width: 100%;
}

.sidebar [data-mip-branding] {
    color: rgba(255, 255, 255, 0.72);
    border-top-color: rgba(255, 255, 255, 0.18);
}

.mip-app-footer {
    padding: 10px 24px 14px;
    margin: 0;
    text-align: start;
    font-size: 0.72rem;
    color: #64748b;
    border-top: 1px solid rgba(100, 116, 139, 0.15);
    background: rgba(248, 250, 252, 0.85);
}

[data-theme="dark"] .mip-app-footer {
    background: rgba(15, 23, 42, 0.9);
    color: #94a3b8;
    border-top-color: rgba(148, 163, 184, 0.2);
}

.login-page .login-card [data-mip-branding],
.login-container [data-mip-branding] {
    border-top: none;
    padding-top: 0.35rem;
    margin-top: 0.75rem;
}

.footer-text--branding {
    margin-top: 0.75rem;
    font-size: 0.8rem !important;
}

.register-hub-branding {
    border-top: none;
    padding-top: 0.5rem;
}

/* Badge ISO graphique commun — /assets/iso.webp (logins tenants) */
.mip-iso-login-img {
    display: block;
    height: clamp(88px, 11.6vw, 116px);
    width: auto;
    max-width: min(680px, 96vw);
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 10px rgba(15, 23, 42, 0.18));
    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.kindi-promo-iso .mip-iso-login-img:hover,
.ph-login-brand .ph-login-promo-iso .mip-iso-login-img:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 5px 14px rgba(15, 23, 42, 0.24));
}

/*
 * Contrôles formulaires : même police que le document (boutons / libellés).
 * Sinon le navigateur impose souvent une police système (ex. Tahoma, Segoe UI).
 */
button,
input,
select,
textarea,
optgroup {
    font-family: inherit;
}

option {
    font-family: inherit;
}

input::file-selector-button {
    font-family: inherit;
}

input::-webkit-file-upload-button {
    font-family: inherit;
}

/* Placeholders plus clairs (saisie, recherche, login) */
input::placeholder,
textarea::placeholder,
select::placeholder {
    color: #c5d0dc;
    opacity: 1;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] select::placeholder {
    color: #8fa0b5;
    opacity: 1;
}
