/* Botoes */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

/* Modais */
body.has-open-modal {
    overflow: hidden;
}

.button-primary {
    color: #fff;
    background: var(--blue);
}

.button-secondary {
    color: var(--text);
    background: #EEF3F8;
    border-color: var(--border);
}

.button-outline {
    color: var(--blue-dark);
    background: #fff;
    border-color: var(--border);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 18px;
    background: rgba(19, 32, 48, 0.56);
}

.modal-overlay.is-top-modal {
    z-index: 1100;
    background: rgba(19, 32, 48, 0.42);
}

.modal-overlay.is-open {
    display: flex;
}

.modal {
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(10, 22, 35, 0.30);
}

.modal-wide {
    width: min(760px, 100%);
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
}

.modal-header {
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    color: var(--blue-dark);
    font-size: 22px;
}

.modal-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #F3F6FA;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.modal-body {
    padding: 22px;
    min-width: 0;
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.form-field {
    display: grid;
    gap: 6px;
    margin-bottom: 15px;
    font-weight: 750;
}

.form-field input,
.form-field select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--blue);
    outline: 3px solid rgba(53, 111, 214, 0.16);
}

.form-field small {
    min-height: 18px;
    color: #B42318;
    font-size: 13px;
}

.form-message {
    display: none;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 750;
}

.form-message.is-error {
    display: block;
    color: #912018;
    background: #FEE4E2;
}

.form-message.is-success {
    display: block;
    color: #05603A;
    background: #D1FADF;
}

.confirmation-message {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.badge-confirmado,
.badge-pago {
    color: #fff;
    background: var(--green);
}

.badge-cancelado {
    color: #fff;
    background: var(--red);
}

.badge-nao_pago {
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--border);
}

.badge-green {
    color: #fff;
    background: var(--green);
}

.badge-red {
    color: #fff;
    background: var(--red);
}

.badge-white {
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .button {
        width: 100%;
        min-height: 44px;
    }

    .modal-overlay {
        align-items: flex-start;
        padding: 10px;
        overflow-y: auto;
    }

    .modal {
        width: 100%;
        max-height: calc(100dvh - 20px);
    }
}

@media (max-width: 560px) {
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 19px;
    }

    .modal-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}
