:root {
    --lado-botao: 3rem;
}

button,
a.button {
    background: no-repeat center;
    flex: 0 0 var(--lado-botao);
    height: var(--lado-botao);
    width: var(--lado-botao);
    border: none;
    outline: none;
    padding: 0 0.5rem;
    white-space: nowrap;
    border-radius: 5px;
    font-size: 1rem;
    color: var(--cor-link);
    display: flex;
    align-items: center;
    justify-content: center;
}

a.button {
    -webkit-tap-highlight-color: transparent;
}

button:hover,
a.button:hover {
    background-color: var(--cor-bege);
    color: black;
}

button:active,
a.button:active {
    background-color: var(--cor-bege);
}

button:focus,
a.button:focus {
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.15);
}

button.menu, a.button.menu,
button.mais, a.button.mais,
button.voltar, a.button.voltar,
button.docar, a.button.docar,
button.person-pin, a.button.person-pin,
button.search, a.button.search,
button.checkbox, a.button.checkbox,
button.edit, a.button.edit,
button.delete, a.button.delete,
button.input, a.button.input,
button.novo, a.button.novo,
button.next, a.button.next,
button.person, a.button.person,
button.check, a.button.check,
button.filter, a.button.filter,
button.tune, a.button.tune,
button.share, a.button.share,
button.swap, a.button.swap,
button.view, a.button.view,
button.close, a.button.close,
button.list-alt, a.button.list-alt,
button.wysiwyg, a.button.wysiwyg,
button.help, a.button.help,
button.zero, a.button.zero {
    border-radius: 50%;
    padding: 0;
}

button.menu, a.button.menu {
    background-image: url("../img/menu.svg");
}

body.menu-docado button.menu, a.button.menu {
    background-image: url("../img/menu-open.svg");
}

button.mais, a.button.mais {
    background-image: url("../img/more-vert.svg");
}

button.voltar, a.button.voltar {
    background-image: url("../img/back.svg");
}

button.docar, a.button.docar {
    background-image: url("../img/room.svg");
}

button.person-pin, a.button.person-pin {
    background-image: url("../img/person-pin.svg");
}

button.search, a.button.search {
    background-image: url("../img/search.svg");
}

button.checkbox, a.button.checkbox {
    background-image: url("../img/checkbox.svg");
}

button.checkbox.checked, a.button.checkbox.checked {
    background-image: url("../img/checkbox-checked.svg");
}

button.edit, a.button.edit {
    background-image: url("../img/edit.svg");
}

button.delete, a.button.delete {
    background-image: url("../img/delete.svg");
}

button.input, a.button.input {
    background-image: url("../img/input.svg");
}

button.novo, a.button.novo {
    background-image: url("../img/add.svg");
}

button.next, a.button.next {
    background-image: url("../img/next.svg");
}

button.person, a.button.person {
    background-image: url("../img/person.svg");
}

button.check, a.button.check {
    background-image: url("../img/check.svg");
}

button.check.checked, a.button.check.checked {
    background-image: url("../img/check-checked.svg");
}

button.check.checked, a.button.check.checked {
    background-image: url("../img/check-checked.svg");
}

button.filter, a.button.filter {
    background-image: url("../img/filter.svg");
}

button.tune, a.button.tune {
    background-image: url("../img/tune.svg");
}

button.tune.tuned, a.button.tune.tuned {
    background-image: url("../img/tune-blue.svg");
}

button.share, a.button.share {
    background-image: url("../img/share.svg");
}

button.swap, a.button.swap {
    background-image: url("../img/swap.svg");
}

button.view, a.button.view {
    background-image: url("../img/view.svg");
}

button.close, a.button.close {
    background-image: url("../img/close.svg");
}

button.list-alt, a.button.list-alt {
    background-image: url("../img/list-alt.svg");
}

button.wysiwyg, a.button.wysiwyg {
    background-image: url("../img/wysiwyg.svg");
}

button.help, a.button.help {
    background-image: url("../img/help.svg");
}

button.zero, a.button.zero {
    background-image: url("../img/zero.svg");
}

.buttons {
    position: relative;
}

.buttons > div {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    border-radius: 0.25rem;
    background: white;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.15);
    display: none;
    flex-flow: column nowrap;
    padding: 0.25rem 0;
}

.buttons > div.aberto {
    display: flex;
}

.buttons > div button, .buttons > div a.button {
    height: var(--lado-botao);
    width: auto;
    min-width: var(--lado-botao);
    text-align: left;
    border-radius: 0;
    padding: 0 1rem 0 0.85rem;
    justify-content: flex-start;
}

.buttons > div button:focus, .buttons > div a.button:focus {
    box-shadow: none;
}

.botoes {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
}

.botoes button,
.botoes a.button {
    flex: 0 0 auto;
    width: auto;
    padding: 0 1rem;
    background: var(--cor-link);
    color: white;
    margin: 0 2px 2px 0;
    border: 1px solid transparent;
    text-decoration: none;
}

.botoes button:last-child, .botoes a.button:last-child {
    margin-right: 0;
    margin-bottom: 0;
}

@media (min-width: 1024px) {
    .botoes button,
    .botoes a.button {
        height: 2.25rem;
        font-size: 1rem;
    }
}

.botoes button:active,
.botoes a.button:active,
.botoes button:focus,
.botoes a.button:focus {
    background: var(--cor-link);
    box-shadow: 0 0 0 0.1rem var(--cor-azul-correios);
}

.botoes button:hover,
.botoes a.button:hover {
    background: var(--cor-azul-correios);
}

.botoes button.primario,
.botoes a.button.primario {
    background: var(--cor-link);
    color: white;
}

.botoes button.desativado,
.botoes a.button.desativado,
.botoes button:disabled,
.botoes a.button:disabled,
.botoes button[disabled],
.botoes a.button[disabled] {
    background: transparent;
    color: black;
    border: 1px solid black;
}

.botoes button.desativado:active,
.botoes a.button.desativado:active,
.botoes button.desativado:focus,
.botoes a.button.desativado:focus {
    box-shadow: none;
}

.botoes button.primario:active,
.botoes a.button.primario:active {
    background: var(--cor-link);
    box-shadow: 0 0 0 0.1rem var(--cor-azul-correios);
}

.botoes button.primario:hover,
.botoes a.button.primario:hover {
    background: var(--cor-azul-correios);
}

.botoes button.alternativo,
.botoes a.button.alternativo {
    background: white;
    color: var(--cor-link);
    border: 1px solid var(--cor-link);
}

.botoes button.alternativo:active,
.botoes a.button.alternativo:active,
.botoes button.alternativo:focus,
.botoes a.button.alternativo:focus {
    background: white;
    color: var(--cor-azul-correios);
    box-shadow: 0 0 0 0.1rem var(--cor-azul-correios);
}

.botoes button.alternativo:hover,
.botoes a.button.alternativo:hover {
    background: var(--cor-azul-correios);
    color: white;
    border: 1px solid var(--cor-azul-correios);
}

.botoes button.perigo,
.botoes a.button.perigo {
    background: var(--cor-alerta);
    color: white;
}

.botoes button.perigo:active,
.botoes a.button.perigo:active,
.botoes button.perigo:focus,
.botoes a.button.perigo:focus {
    background: var(--cor-alerta);
    box-shadow: 0 0 0 0.1rem var(--cor-alerta-escuro);
}

.botoes button.perigo:hover,
.botoes a.button.perigo:hover {
    background: var(--cor-alerta-escuro);
}

.botoes button.confirmacao,
.botoes a.button.confirmacao {
    background: var(--cor-confirmacao);
    color: white;
}

.botoes button.confirmacao:active,
.botoes a.button.confirmacao:active,
.botoes button.confirmacao:focus,
.botoes a.button.confirmacao:focus {
    background: var(--cor-confirmacao);
    box-shadow: 0 0 0 0.1rem var(--cor-confirmacao-escuro);
}

.botoes button.confirmacao:hover,
.botoes a.button.confirmacao:hover {
    background: var(--cor-confirmacao-escuro);
}

.botoes button.link,
.botoes a.button.link {
    background: transparent;
    color: var(--cor-link);
}

.botoes button.link:active,
.botoes a.button.link:active,
.botoes button.link:focus,
.botoes a.button.link:focus {
    color: var(--cor-link-hover);
    box-shadow: 0 0 0 0.1rem var(--cor-link-hover);
}

.botoes button.link:hover,
.botoes a.button.link:hover {
    color: var(--cor-link-hover);
}

button.novo,
a.button.novo,
button.next,
a.button.next {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 3.5rem;
    height: 3.5rem;
    background-size: 2rem;
    background-color: var(--cor-bege);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

button.next,
a.button.next {
    background-color: var(--cor-link);
}

button.novo:hover,
a.button.novo:hover,
button.next:hover,
a.button.next:hover {
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.4);
}

button.novo:active,
a.button.novo:active,
button.next:active,
a.button.next:active {
    background-color: var(--cor-bege);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.8);
}

button.next:active,
a.button.next:active {
    background-color: var(--cor-link);
}

#regiao-botoes {
    height: 3.5rem;
}

button.tag,
a.button.tag {
    flex: 0 1 auto;
    width: auto;
    border-radius: 2rem;
    height: 2rem;
    font-size: 0.8rem;
    margin: 0 0.5rem;
}

button.tag.selected,
a.button.tag.selected {
    background: var(--cor-link);
    color: white;
    box-shadow: 0 0 0 0.1rem var(--cor-azul-correios);
}

@media (min-width: 1024px) {
    button.novo,
    a.button.novo,
    button.next,
    a.button.next {
        right: auto;
        left: 50%;
        margin-left: calc(-3.5rem / 2);
        bottom: 1.5rem;
    }

    body.menu-aberto button.novo,
    body.menu-aberto a.button.novo,
    body.menu-aberto button.next,
    body.menu-aberto a.button.next {
        margin-left: calc((-3.5rem + 15rem) / 2);
    }

    #regiao-botoes {
        height: 4rem;
    }
}

button.flat,
a.button.flat {
    margin: 0 2px;
    font-size: 0.8rem;
    width: auto;
}

@media (min-width: 768px) {
    button.flat,
    a.button.flat {
        height: 2.1rem;
    }
}

/* Botões em alto contraste */
body.alto-contraste .botoes button,
body.alto-contraste .botoes a.button,
body.alto-contraste .botoes button:hover,
body.alto-contraste .botoes a.button:hover,
body.alto-contraste .botoes button.primario,
body.alto-contraste .botoes a.button.primario,
body.alto-contraste .botoes button.primario:hover,
body.alto-contraste .botoes a.button.primario:hover,
body.alto-contraste .botoes button.alternativo,
body.alto-contraste .botoes a.button.alternativo,
body.alto-contraste .botoes button.alternativo:hover,
body.alto-contraste .botoes a.button.alternativo:hover,
body.alto-contraste .botoes button.perigo,
body.alto-contraste .botoes a.button.perigo,
body.alto-contraste .botoes button.perigo:hover,
body.alto-contraste .botoes a.button.perigo:hover,
body.alto-contraste .botoes button.confirmacao,
body.alto-contraste .botoes a.button.confirmacao,
body.alto-contraste .botoes button.confirmacao:hover,
body.alto-contraste .botoes a.button.confirmacao:hover,
body.alto-contraste button.tag.selected,
body.alto-contraste a.button.tag.selected {
    background-color: var(--cor-link-contraste);
    color: black;
    border: 1px solid transparent;
}

body.alto-contraste .botoes button:active,
body.alto-contraste .botoes a.button:active,
body.alto-contraste .botoes button:focus,
body.alto-contraste .botoes a.button:focus,
body.alto-contraste .botoes button.primario:active,
body.alto-contraste .botoes a.button.primario:active,
body.alto-contraste .botoes button.alternativo:active,
body.alto-contraste .botoes a.button.alternativo:active,
body.alto-contraste .botoes button.alternativo:focus,
body.alto-contraste .botoes a.button.alternativo:focus,
body.alto-contraste .botoes button.perigo:active,
body.alto-contraste .botoes a.button.perigo:active,
body.alto-contraste .botoes button.perigo:focus,
body.alto-contraste .botoes a.button.perigo:focus,
body.alto-contraste .botoes button.confirmacao:active,
body.alto-contraste .botoes a.button.confirmacao:active,
body.alto-contraste .botoes button.confirmacao:focus,
body.alto-contraste .botoes a.button.confirmacao:focus,
body.alto-contraste button.tag,
body.alto-contraste a.button.tag {
    background-color: black;
    color: var(--cor-link-contraste);
    box-shadow: 0 0 0 0.1rem var(--cor-link-contraste);
}

body.alto-contraste .botoes button.desativado,
body.alto-contraste .botoes a.button.desativado,
body.alto-contraste .botoes button:disabled,
body.alto-contraste .botoes a.button:disabled,
body.alto-contraste .botoes button[disabled],
body.alto-contraste .botoes a.button[disabled] {
    background: transparent;
    color: white;
    border: 1px solid white;
}

body.alto-contraste .botoes button.link,
body.alto-contraste .botoes a.button.link {
    background-color: black;
    color: var(--cor-link-contraste);
}

body.alto-contraste .botoes button.link:hover,
body.alto-contraste .botoes a.button.link:hover,
body.alto-contraste .botoes button.link:active,
body.alto-contraste .botoes a.button.link:active,
body.alto-contraste .botoes button.link:focus,
body.alto-contraste .botoes a.button.link:focus {
    box-shadow: 0 0 0 0.1rem var(--cor-link-contraste);
}

body.alto-contraste button,
body.alto-contraste a.button {
    background-color: none;
}

.botoes button.link:hover, .botoes a.button.link:hover {
    background-image: none;
}

body.alto-contraste .botoes button.link, body.alto-contraste .botoes a.button.link {
    background-image: none;
}

.botoes button.link:focus,
.botoes a.button.link:focus,
.botoes button.link:active,
.botoes a.button.link:active,
body.alto-contraste .botoes button.link:focus,
body.alto-contraste .botoes a.button.link:focus,
body.alto-contraste .botoes button.link:active,
body.alto-contraste .botoes a.button.link:active {
    border: 1px solid transparent;
    box-shadow: none;
}

body.alto-contraste .botoes button.link:hover,
body.alto-contraste .botoes a.button.link:hover,
body.alto-contraste .botoes button.link:active,
body.alto-contraste .botoes a.button.link:active,
body.alto-contraste .botoes button.link:focus,
body.alto-contraste .botoes a.button.link:focus {
    border: 1px solid transparent;
    box-shadow: none;
}