:root {
    --primary: #005091;
    --secondary: #006dc7;
    --tertiary: #002644;
    --quaternary: #1395ff;
    --background: #fafafa;
    --foreground: #fff;
    --green: #0fb90f;
    --red: #c02626;
}

.modal-overlay {
    --yes-button-background-color: var(--primary);
    --yes-button-text-color: #fff;
    --yes-button-hover-background-color: var(--secondary);
    --yes-button-hover-text-color: #fff;
    --yes-button-active-background-color: var(--tertiary);
    --yes-button-active-text-color: #fff;

    --no-button-background-color: #ddd;
    --no-button-text-color: #333;
    --no-button-hover-background-color: #cacaca;
    --no-button-hover-text-color: #444;
    --no-button-active-background-color: #b7b7b7;
    --no-button-active-text-color: #000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
}

body {
    height: 100vh;
    overflow-y: hidden;

    display: flex;
    flex-direction: column;
    justify-content: stretch;

    background-color: var(--background);
}

body::before {
    content: " ";
    background-color: #0007;

    position: absolute;
    top: 0;
    left: 0;
    z-index: 998;

    width: 100%;
    height: 100%;

    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

body::after {
    content: " ";
    border: 0.5rem solid #fff;
    border-left-color: var(--primary);
    border-radius: 50%;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    z-index: 999;

    width: min(20vw, 5rem);
    height: min(20vw, 5rem);

    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;

    animation: spinner 1s linear infinite;
}

body.loading * {
    pointer-events: none;
}

body.loading::before {
    pointer-events: all;
    opacity: 1;
}

body.loading::after {
    pointer-events: all;
    opacity: 1;
}

@keyframes spinner {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

header,
footer {
    flex: 0;
}

header h1 {
    text-align: center;
    margin: 1rem 0;
    color: var(--primary);
}

hr {
    border: 0;
    border-top: 0.2em solid var(--primary);
}

main {
    flex: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}

img {
    width: min(65vw, 15rem);
}

.card {
    display: flex;
    flex-direction: row;
    position: relative;

    width: min(85vw, 22rem);
    overflow-x: hidden;

    border-radius: 1rem;
    background-color: var(--foreground);
    border: 2px solid #333;
    /* box-shadow: 
        -0.5rem -0.5rem 0.5rem #fff7,
        0.5rem 0.5rem 0.5rem #0007; */
}

.subcard {
    position: relative;
    padding: 2rem 1rem;

    min-width: 100%;
    width: 100%;
    max-width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    opacity: 1;
}

.subcard.hidden {
    opacity: 0;
}

input,
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    color: #444;
    background-color: #fefefe;
    background-clip: padding-box;
    border: 1px solid #777;
    border-radius: 0.25rem;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
    font-size: 1em !important;
    padding: 0px 5px !important;
    overflow: visible;
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
    text-indent: 0px;
    text-shadow: none;
    text-align: start;
    appearance: textfield;
    writing-mode: horizontal-tb !important;
    -webkit-writing-mode: horizontal-tb !important;
    text-rendering: auto;
    -webkit-rtl-ordering: logical;
    outline-color: var(--color-outline);
    outline-width: 1px;
    margin-bottom: 1rem;
    height: 1.8em !important;
    line-height: 1.8em !important;
}

input:not(:disabled),
textarea:not(:disabled) {
    cursor: text;
}

textarea {
    height: initial !important;
    line-height: 1.3em;
    resize: none;
}

input:disabled,
textarea:disabled,
select:disabled {
    background-color: #e7e7e7;
}

label {
    color: #444;
}

button {
    outline: none;
    cursor: pointer;

    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;

    background-color: var(--primary);
    color: var(--foreground);
    font-size: 1rem;
    font-weight: bold;

    transition: 0.2s;
}

button:hover {
    background-color: var(--secondary);
}

button:active {
    background-color: var(--tertiary);
}

button:disabled,
button[disabled] {
    background-color: #567792;
    pointer-events: none;
}

button.outline {
    padding: 0.35rem 0.85rem;

    background-color: transparent;
    border: 0.15em solid var(--primary);
    color: var(--primary);
}

button.outline:hover {
    border: 0.15em solid var(--secondary);
    color: var(--secondary);
}

button.outline:active {
    border: 0.15em solid var(--tertiary);
    color: var(--tertiary);
}

h3,
h4 {
    color: var(--tertiary);
}

p {
    color: var(--tertiary);
    text-align: justify;
}

.btn-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    margin-top: 1rem;
}

#result-card p {
    margin: 1rem 0;
}

span.total {
    color: var(--red);
    font-weight: bold;
}

span.sim {
    --color: var(--green);
    color: var(--color);
    width: 100%;
    text-align: left;
    position: relative;
}

span.nao {
    --color: var(--red);
    color: var(--color);
    width: 100%;
    text-align: left;
    position: relative;
}

span.bar {
    background-color: var(--color);
    position: absolute;

    top: 0;
    left: 2.5rem;
    height: 1rem;
    min-width: 0.5rem;

    border-top-right-radius: 0.4rem;
    border-bottom-right-radius: 0.4rem;

    transition: 0.2s;
}

span.dados {
    position: absolute;
    top: 0;
    left: 2.5rem;
    white-space: nowrap;
    transition: 0.2s;
}

#wait-card {
    justify-content: flex-start;
}

#contador {
    font-size: 4rem;
    color: var(--secondary);
    margin: auto;
}

#contador.show-days {
    font-size: 3.1rem;
}

#help-card {
    padding: 1rem;
}

#help-card input {
    margin-bottom: 0.2rem;
}

footer hr {
    margin: 0 0 2rem 0;
}

.modal-overlay {
    --modal-width: max(40vw, 21rem);
}

.hidden {
    opacity: 0;
}

.vote-options {
    width: 100%;
    appearance: none;
    list-style: none;
    margin-top: 1rem;
}

.vote-options li {
    display: flex;
}

.vote-options li:not(:last-child) {
    margin-bottom: 1rem;
}

.vote-options input {
    appearance: none;
    display: none;
}

.vote-options label {
    padding: 0.25rem 0.5rem .25rem 2rem;
    width: 100%;
    transition: 0.2s;
    cursor: pointer;
    position: relative;
    background-color: #f0f0f0;
}

.vote-options label:hover {
    background-color: #e7e7e7;
}

.vote-options label::before {
    content: "";
    width: 1rem;
    height: 1rem;
    top: .25rem;
    left: .25rem;
    border: 2px solid #333;
    border-radius: .25rem;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-options input:checked+label::before {
    content: "X";
}

.vote-options li:first-child input:checked+label {
    background-color: #0fb90f33;
}

.vote-options li:last-child input:checked+label {
    background-color: #c0262633;
}

.result-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.result-title {
    width: 100%;
    text-align: center;
}

.result-title[data-quantity]::after {
    content: attr(data-quantity);
    margin-left: .25rem;
}

.result-bar {
    width: 100%;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.result-bar-section {
    width: 50%;
    text-align: center;
    background-color: #ddd;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-wrap: nowrap;
    word-break: keep-all;
    color: white;
    user-select: none;
}

.result-bar-section:first-child {
    border-top-left-radius: .75rem;
    border-bottom-left-radius: .75rem;
}

.result-bar-section:last-child {
    border-top-right-radius: .75rem;
    border-bottom-right-radius: .75rem;
}

.result-bar-section[data-quantity]::after {
    content: attr(data-quantity);
    margin-left: .25rem;
}

.result-bar-section:nth-child(1) {
    background-color: var(--green);
}

.result-bar-section:nth-child(2) {
    background-color: var(--red);
}

.result-bar-section:nth-child(3) {
    background-color: var(--quaternary);
}
