form {
    display: flex;
    flex-flow: column nowrap;
    gap: 1rem;
    margin: 0 0 2rem 0;
}
form.change-password {
    max-width: 24rem;
}
form.change-password fieldset {
    flex-flow: column nowrap;
}
form h1, form h2, form h3, form h4, form h5, form h6 {
    margin-bottom: 0;
}
form h1:first-child, form h2:first-child, form h3:first-child, form h4:first-child, form h5:first-child, form h6:first-child {
    margin-top: 0;
}
details + form,
summary + form {
    margin-top: 2rem;
}
fieldset {
    border-radius: 0.5em;
    display: flex;
    flex-flow: column nowrap;
    padding: 1rem;
    gap: 1rem;
}
fieldset:empty {
    display: none;
}
form > fieldset {
    flex-flow: row wrap;
}

.revisao form > fieldset {
    flex-wrap: nowrap;
}
@media (max-width: 670px) {
    .revisao form > fieldset {
        flex-flow: column nowrap;
    }
}
.revisao form > fieldset .field{
    flex: 1;
}
.revisao form > fieldset .field.textarea { 
    flex: 2;
}
.revisao form > fieldset textarea { 
    min-height: 4.5rem;
}
.field {
    display: flex;
    flex-flow: row wrap;
    gap: 0.5rem 0.25rem;
    margin-bottom: 1rem;
}
fieldset.field,
.field:last-child {
    margin: 0;
    flex: 0 1 calc(20% - 0.80em);
}
.field:first-child {
    flex: 1 1 100%;
}
.field > * {
    flex: 0 1 100%;
}
.field p {
    margin: 0.25em 0 0 0;
    font-size: 0.92em;
    font-weight: 500;
    line-height: 1.2em;
}
.field.title {
    flex: 0 1 100%;
}
@keyframes error-field-show {
    0% {
        opacity: 0;
        padding: 0;
        max-height: 0;
    }
    100% {
        opacity: 1;
        padding: 0.5em 1em;
        max-height: max-content;
    }
}
.error-field {
    color: var(--error-color);
    background-color: var(--error-color-bg);
    padding: 0.5em 1em;
    border-radius: 0.5em;
    font-size: 0.9em;
    font-weight: 500;
    max-height: 5em;
    animation: error-field-show 0.5s ease-out;
    transition: 0.4ms;
}
.error-field.removing {
    opacity: 0;
    padding: 0;
    max-height: 0;
    transition: 0.5s;
    margin: -0.5rem 0;
}

.error-form {
    color: var(--error-color);
    background-color: var(--error-color-bg);
    padding: 0.5em 1em;
    border-radius: 0.5em;
    font-size: 0.9em;
    font-weight: 500;
    max-height: 5em;
    animation: error-field-show 0.5s ease-out;
    transition: 0.4ms;
}
.error-form.removing {
    opacity: 0;
    padding: 0;
    max-height: 0;
    transition: 0.5s;
    margin: -0.5rem 0;
}


.msg-form {
    padding: 0.75em 1em;
    border-radius: 0.5em;
    font-size: 1.2em;
    font-weight: 500;
    max-height: 5em;
    width: max-content;
    animation: error-field-show 0.5s ease-out;
    transition: 0.4ms;
    position: sticky;
    top: 1em;
    left: 1em;
    max-width: 100%;
}
.msg-form.error {
    color: var(--error-color);
    background-color: var(--error-color-bg);
}
.msg-form.success {
    color: var(--success-color);
    background-color: var(--success-color-bg);
}
.msg.removing,
.msg-form.removing {
    opacity: 0;
    padding: 0;
    max-height: 0;
    transition: 0.5s;
    margin: -0.5rem 0;
}

.field.password input {
    flex: 0 1 calc(100% - 2.75rem);
}
.field.password button {
    flex: 0 1 2.5rem;
    background: url('../assets/eye-closed-white.svg') no-repeat center / 1.3em;
    position: relative;
}
.field.password button.allow {
    background-image: url('../assets/eye-open-white.svg');
}
.field > label {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-weight: 700;
}
.field > label small {
    font-weight: lighter;
}
.field.image img {
    width: 100%;
    object-fit: cover;
    border-radius: 0.25rem;
}
input, select, textarea {
    font-size: inherit;
    border-radius: 0.25em;
    border: 1px solid #ffffff8a;
    padding: 0.5em;
}
textarea {
    resize: vertical;
    min-height: 4em;
}
.input-checkbox input + label {
    display: inline;
} 
.buttons {
    display: flex;
    flex-flow: column wrap;
    gap: 0.5rem;
    align-items: center;
}
.button,
button {
    cursor: pointer;
    font-weight: 600;
    font-size: inherit;
    height: 2.25em;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
    /*
    color: inherit;
    padding: 0.25em 0.75em;
    background-color: var(--bg-color-over);
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    */
}
@media (max-width: 640px) {
    .button .button, .buttons button {
        width: 100%;
    }
}
button:not(.see-password):hover {
    opacity: 0.8;
}
.submit,
button[type="submit"] {
    font-family: var(--font-family-title);
    font-weight: 700; 
    /* background-color: var(--color-emphasis); */
    color: var(--color-emphasis-over);
}
button[type='submit']:disabled,
button[type='submit']:disabled:hover,
button:disabled {
    background-color: var(--bg-disabled) !important;
    opacity: 0.4;
    cursor: default;
}
button.super {
    border-width: 3px;
    color: var(--text-color);
    background-color: #0003;
    height: 3.5rem;
    border-radius: 4rem;
    font-size: 110%;
    font-weight: 800;
    margin: 1rem 0;
}
@keyframes spin {
    0% {
        transform: rotate(0);
    }
    100% {
        transform: rotate(359deg);
    }
}
form.loading {
    opacity: 0.5;
}

form.loading .field.password button.allow::after {
    display: none;
}
form.loading button[type="submit"] {
    color: transparent;
    position: relative;
}
.loading button[type="submit"]::before {
    content: "";
    background: transparent url(../assets/loading.png) no-repeat center / 80%;
    animation: spin 1s linear infinite;
    position: absolute;
    width: 2em;
    height: 2em;
    margin: -1em auto auto -1em;
    top: 50%;
    left: 50%;
    border-radius: 50%;
}
.field.input-checkbox {
    flex-flow: row nowrap;
    align-items: center;
}
input[type="checkbox"] {
    flex: 0 0 1.5em;
}
.placeholder-loading {
    background: url('/assets/placeholder-loading.svg') 0 0 / 100%;
    height: calc(50vw - 4rem);
    width: 100%;
    animation: placeholder-loading 2s ease-in-out infinite;
}
form.inscricao .field.id_categoria {
    flex-basis: 100%;
}
form.inscricao .field.id_categoria.selected {
    flex-basis: calc(100% - 15rem);
}
form.inscricao .valores {
    flex-basis: 10rem;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
form.inscricao .descricoes > div,
form.inscricao .valores > div {
    display: none;
}
form.inscricao .descricoes > div {
    margin: 1rem 0 3rem 0;
}
form.inscricao .descricoes b {
    white-space: pre-line;
}
form.inscricao .valores b {
    font-size: 1.75rem;
    font-weight: 700;
}
form.inscricao .descricoes > div.show,
form.inscricao .valores > div.show {
    display: flex;
    flex-flow: column nowrap;
    gap: 0.25rem;
}
.dados {
    display: flex;
    flex-flow: column nowrap;
    gap: 1.5rem;
    flex: 1;
}
.dados .field.read label {
    color: var(--text-color-weak);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}
.dados .field.read label + * {
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 400;
}
.confirmacao {
    display: none;
}
.confirmacao fieldset {
    background-color: var(--bg-color-over);
}
.descricoes {
    flex: 100%;
}
@keyframes placeholder-loading {
    0% { opacity: 0.2; }
    50% { opacity: 0.9; }
    100% { opacity: 0.2; }
}

@media (max-width: 580px) {
    form.inscricao .field.id_categoria.selected {
        flex-basis: 100%;
    }
    form.inscricao .descricoes,
    form.inscricao .valores {
        flex-basis: 100%;
        text-align: center;
    }
    form.inscricao .descricoes > div,
    form.inscricao .valores > div {
        padding: 1rem 0 0 0;
    }
}

@media (min-width: 640px) {
    .field {
        flex: 1 1 calc(40% - 0.5rem);
        align-content: flex-start;
    }
    .buttons {
        flex-flow: row wrap;
        width: 100%;
    }
    .auth-dialog .buttons {
        flex-flow: column nowrap;
    }
    .button.submit,
    button[type="submit"] {
        order: 2;
        margin-left: auto;
    }
    .auth-dialog button[type="submit"] {
        order: unset;
        margin-left: unset;
    }
}
@media (min-width: 960px) {
    .field {
        flex: 1 1 calc(25% - 0.5rem);
        align-content: flex-start;
    }
}

table input[type='checkbox'],
table input[type='radio'] {
    width: 60%;
    height: 1em;
}