/* ============================================================
   MAISSDoc — Autenticação v2 (estilo DocuSign)
   Branco minimalista: card com borda fina, botão escuro sólido,
   rodapé com links legais. Máxima sobriedade e confiança.
   ============================================================ */

.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: #ffffff;
}

/* ---------- barra superior (só a marca) ---------- */
.auth-topbar {
    padding: 1.4rem 2rem;
}
.auth-topbar .logo-txt {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #1d2939;
}
.auth-topbar .logo-txt span { color: #4f46e5; }

/* ---------- área central ---------- */
.auth-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 3rem;
}

.auth-card {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}
.auth-card .card-inner { padding: 2.75rem 3rem 3rem; }

.auth-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1d2939;
    margin-bottom: 0.4rem;
}
.auth-subtitle {
    font-size: 0.9rem;
    color: #475467;
    margin-bottom: 1.75rem;
}

/* campos */
.auth-card .form-label {
    font-weight: 500;
    color: #344054;
    margin-bottom: 0.4rem;
}
.auth-card .form-control {
    min-height: 48px;
    border-radius: 4px;
    border-color: #d0d5dd;
    font-size: 0.92rem;
}
.auth-card .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}
.auth-card a { color: #4f46e5; }
.auth-card a:hover { color: #4338ca; }

/* botão principal escuro (padrão DocuSign) */
.btn-auth-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 4px;
    background: #1a2c63;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.15s ease;
}
.btn-auth-primary:hover,
.btn-auth-primary:focus { background: #14224e; color: #ffffff; }
.btn-auth-primary:disabled { background: #1a2c63; opacity: 0.75; color: #fff; }

/* botão secundário claro */
.btn-auth-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 4px;
    background: #f2f4f7;
    color: #344054;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.btn-auth-secondary:hover,
.btn-auth-secondary:focus { background: #e9ecf2; color: #1d2939; }

/* aviso de Caps Lock (preenchido via JS) */
.capslock-hint {
    display: none;
    font-size: 0.78rem;
    color: #b54708;
    margin-top: 0.35rem;
}
.capslock-hint.is-on { display: block; }

/* ---------- convite de instalação do PWA ---------- */
.pwa-install-card {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 0.85rem;
    padding: 1rem 2.7rem 1rem 1rem;
    overflow: hidden;
    border: 1px solid #d9ddff;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    color: #1d2939;
}
.pwa-install-card[hidden] { display: none !important; }
.pwa-install-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(79, 70, 229, 0.14);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.12);
}
.pwa-install-icon img {
    width: 34px;
    height: 34px;
}
.pwa-install-content { min-width: 0; }
.pwa-install-eyebrow {
    margin: 0 0 0.1rem;
    color: #4f46e5;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.pwa-install-content h2 {
    margin: 0;
    color: #1d2939;
    font-size: 0.98rem;
    font-weight: 700;
}
.pwa-install-description,
.pwa-install-instructions {
    margin: 0.3rem 0 0;
    color: #5d6678;
    font-size: 0.78rem;
    line-height: 1.45;
}
.pwa-install-instructions {
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #344054;
}
.pwa-install-action {
    margin-top: 0.65rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #4338ca;
    font-size: 0.78rem;
    font-weight: 700;
}
.pwa-install-action:hover,
.pwa-install-action:focus-visible {
    color: #312e81;
    text-decoration: underline;
}
.pwa-install-action:disabled { opacity: 0.6; }
.pwa-install-dismiss {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #667085;
}
.pwa-install-dismiss:hover,
.pwa-install-dismiss:focus-visible {
    background: rgba(79, 70, 229, 0.1);
    color: #312e81;
}

/* ---------- rodapé ---------- */
.auth-footer {
    flex-shrink: 0;
    padding: 1.25rem max(1rem, env(safe-area-inset-right, 0px)) max(1.75rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    text-align: center;
}
.auth-footer .links {
    font-size: 0.8rem;
    color: #667085;
    margin-bottom: 0.4rem;
}
.auth-footer .links a {
    color: #667085;
    text-decoration: none;
    margin: 0 0.65rem;
}
.auth-footer .links a:hover { color: #1a2c63; text-decoration: underline; }
.auth-footer .copyright {
    font-size: 0.75rem;
    color: #98a2b3;
    margin: 0;
}

/*
 * O shell interno troca para mobile em <992px. A autenticação precisa usar
 * o mesmo corte para não exibir um card desktop estreito em celulares que
 * reportam viewport de tablet (comum em Android/Xiaomi e no "site desktop").
 */
@media (max-width: 991.98px) {
    .auth-topbar {
        padding:
            calc(1rem + env(safe-area-inset-top, 0px))
            max(1.25rem, env(safe-area-inset-right, 0px))
            1rem
            max(1.25rem, env(safe-area-inset-left, 0px));
    }
    .auth-main {
        align-items: flex-start;
        padding:
            clamp(2rem, 7dvh, 5rem)
            max(1.25rem, env(safe-area-inset-right, 0px))
            calc(2.5rem + env(safe-area-inset-bottom, 0px))
            max(1.25rem, env(safe-area-inset-left, 0px));
    }
    .auth-card {
        max-width: 680px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .auth-card .card-inner { padding: 0; }
    .pwa-install-card {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 0.9rem 2.5rem 0.9rem 0.9rem;
    }
    .pwa-install-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    .pwa-install-icon img {
        width: 30px;
        height: 30px;
    }
}

@media (display-mode: standalone) and (max-width: 991.98px) {
    .auth-main,
    .auth-card {
        width: 100%;
    }
}

@media (max-width: 359.98px) {
    .auth-main {
        padding-inline:
            max(1rem, env(safe-area-inset-right, 0px))
            max(1rem, env(safe-area-inset-left, 0px));
    }
    .auth-title { font-size: 1.4rem; }
}
