/* M&M ID — modal de login compartilhado. Unidades em px de propósito: o tema
   público define html{font-size:62.5%} (1rem = 10px), então usar rem aqui
   herdaria essa escala e tudo saía ~40% menor do que parece no CSS. Fontes e
   cores seguem o mesmo design system da SPA MMID (mmid/admin/src/style.css). */

.mm-login-modal[hidden] {
    display: none;
}

.mm-login-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', system-ui, sans-serif;
}

.mm-login-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 30, .6);
}

.mm-login-modal__box {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 32px 32px;
    width: 90%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    box-sizing: border-box;
}

.mm-login-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 999px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #757575;
    transition: background .15s ease, color .15s ease;
}

.mm-login-modal__close:hover {
    background: #f5f5f5;
    color: #1e1e1e;
}

.mm-login-modal__box h4 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: #1e1e1e;
}

.mm-login-modal__box p {
    font-size: 14px;
    line-height: 1.5;
    color: #757575;
    margin: 0 0 20px;
}

.mm-login-modal__box p a {
    color: #0034ff;
    font-weight: 500;
    text-decoration: none;
}

.mm-login-modal__box p a:hover {
    text-decoration: underline;
}

.mm-login-modal__box label {
    display: block;
    margin-bottom: 12px;
}

.mm-login-modal__box input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 15px;
    color: #1e1e1e;
    box-sizing: border-box;
    transition: border-color .15s ease;
}

.mm-login-modal__box input::placeholder {
    color: #8c8c8c;
}

.mm-login-modal__box input:focus {
    outline: none;
    border-color: #0034ff;
}

.mm-login-modal__box button[type="submit"] {
    width: 100%;
    padding: 13px;
    background: #0034ff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background .15s ease;
}

.mm-login-modal__box button[type="submit"]:hover:not(:disabled) {
    background: #1a4aff;
}

.mm-login-modal__box button[type="submit"]:disabled {
    opacity: .6;
    cursor: default;
}

.mm-login-modal__error {
    color: #b3261e;
    background: #fff7f7;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Inter', system-ui, sans-serif;
    margin: -4px 0 14px;
}

.mm-login-modal__box hr {
    border: none;
    border-top: 1px solid #eeeeee;
    margin: 24px 0 20px;
}

.mm-login-modal__google {
    display: flex;
    justify-content: center;
}

body.mm-login-modal-open {
    overflow: hidden;
}

/* Indicador no link "Login" do header enquanto o menu troca pro estado
   autenticado (login em cookie: o modal já fechou, mas handleMenu() ainda
   está buscando os dados do usuário) — sem isso o header fica alguns
   segundos parecendo que nada aconteceu depois do login. Overlay em cima
   do próprio botão (esconde o texto/ícone, spinner centralizado por
   cima) — nada flutuando fora da caixa do elemento, sem risco de cortar
   no topo do viewport (o header não tem espaço acima).*/
.mm-login-trigger-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: wait;
}

.mm-login-trigger-loading img {
    visibility: hidden;
}

.mm-login-trigger-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(0, 52, 255, .25);
    border-top-color: #0034ff;
    border-radius: 999px;
    animation: mm-login-trigger-spin .6s linear infinite;
}

@keyframes mm-login-trigger-spin {
    to {
        transform: rotate(360deg);
    }
}
