/* =========================================================
   TERMO DE ACEITE - CADASTRO
   ========================================================= */

.terms-register-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-top: 8px;
    padding: 14px 16px;

    background: #f8f9fa;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.terms-register-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 3px;
}

.terms-register-info strong {
    font-size: 12px;
    font-weight: 800;
}

.terms-register-info span {
    color: var(--color-text-muted);

    font-size: 10px;
    line-height: 1.4;
}

.terms-open-button {
    flex-shrink: 0;

    padding: 9px 12px;

    color: var(--color-primary);
    background: #ffffff;

    border: 1px solid rgba(255, 101, 0, 0.35);
    border-radius: 9px;

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
}

.terms-open-button:hover {
    background: #fff8f3;
    border-color: var(--color-primary);
}

.terms-register-box.terms-accepted {
    background: #f6fbf7;
    border-color: #b9dec2;
}

.terms-register-box.terms-accepted .terms-register-info span {
    color: #327442;
    font-weight: 700;
}


/* MODAL */

body.modal-open {
    overflow: hidden;
}

.terms-modal[hidden] {
    display: none !important;
}

.terms-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.terms-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(17, 24, 39, 0.62);
    backdrop-filter: blur(2px);
}

.terms-modal-dialog {
    position: relative;
    z-index: 1;

    width: min(100%, 680px);
    max-height: calc(100vh - 48px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid var(--color-border);
    border-radius: 20px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.24);
}

.terms-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 24px 26px 18px;

    border-bottom: 1px solid var(--color-border);
}

.terms-modal-header .eyebrow {
    margin-bottom: 6px;
}

.terms-modal-header h3 {
    margin: 0;

    color: var(--color-dark);

    font-size: 21px;
    line-height: 1.25;
}

.terms-version {
    display: block;

    margin-top: 5px;

    color: var(--color-text-muted);

    font-size: 10px;
    font-weight: 600;
}

.terms-modal-close {
    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: var(--color-text-muted);
    background: #f5f6f7;

    border: 0;
    border-radius: 9px;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.terms-modal-close:hover {
    color: var(--color-dark);
    background: #eceef0;
}

.terms-scroll-message {
    padding: 11px 26px;

    color: var(--color-text-muted);
    background: #fafafa;

    border-bottom: 1px solid var(--color-border);

    font-size: 10px;
    line-height: 1.4;
}

.terms-modal-content {
    min-height: 180px;
    max-height: 390px;

    overflow-y: auto;

    padding: 24px 26px;

    color: var(--color-text);

    font-size: 13px;
    line-height: 1.7;

    white-space: normal;
}

.terms-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 18px 26px;

    background: #ffffff;

    border-top: 1px solid var(--color-border);
}

.terms-confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    color: var(--color-text);

    font-size: 11px;
    line-height: 1.45;

    cursor: pointer;
}

.terms-confirm-label input {
    margin-top: 1px;
}

.terms-confirm-label.terms-disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.terms-modal-footer .btn {
    min-height: 40px;
    padding: 0 18px;

    border: 0;
    border-radius: 10px;

    font: inherit;
    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
}

.terms-modal-footer .btn-primary {
    color: #ffffff;
    background: var(--color-primary);
}

.terms-modal-footer .btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.terms-modal-footer .btn:disabled {
    color: #9ca3af;
    background: #e5e7eb;

    cursor: not-allowed;
}


/* RESPONSIVO DO MODAL */

@media (max-width: 600px) {

    .terms-register-box {
        align-items: stretch;
        flex-direction: column;
    }

    .terms-open-button {
        width: 100%;
    }

    .terms-modal {
        padding: 14px;
    }

    .terms-modal-dialog {
        max-height: calc(100vh - 28px);
        border-radius: 16px;
    }

    .terms-modal-header {
        padding: 20px 18px 15px;
    }

    .terms-scroll-message {
        padding: 10px 18px;
    }

    .terms-modal-content {
        max-height: 46vh;
        padding: 20px 18px;
    }

    .terms-modal-footer {
        align-items: stretch;
        flex-direction: column;

        padding: 15px 18px;
    }

    .terms-modal-footer .btn {
        width: 100%;
    }
}
