﻿/* =========================================================
   IncentivizeMe Dialog Shell
   Scoped to dialogs opened with CssClass = "im-dialog"
   ========================================================= */

.im-dialog {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

    .im-dialog .rz-dialog-titlebar {
        display: none;
    }

    .im-dialog .rz-dialog-content {
        padding: 0;
        overflow: hidden;
    }

.im-dialog-wrapper .rz-dialog-mask {
    background: rgba(15, 23, 42, 0.45);
}

/* =========================================================
   Internal Modal Layout
   ========================================================= */

.im-modal {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 860px);
    background: #ffffff;
}

.im-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: var(--color-background-secondary);
    flex: 0 0 auto;
}

.im-modal__title-block {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.im-modal__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #00ab84;
    background: rgba(0, 171, 132, 0.12);
}

.im-modal__title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}

.im-modal__subtitle {
    margin-top: .15rem;
    font-size: .82rem;
    color: #64748b;
}

.im-modal__close {
    color: #475569;
}

.im-modal__body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.im-modal__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: var(--color-background-secondary);
    flex: 0 0 auto;
}

    .im-modal__primary-action {
        min-width: 150px;
    }

/* =========================================================
   Shared Form Styling
   ========================================================= */

.im-form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.im-field {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.im-label {
    font-size: .86rem;
    font-weight: 700;
    color: #334155;
}

.im-input {
    width: 100%;
}

    .im-input.rz-textbox,
    .im-input.rz-dropdown {
        min-height: 42px;
    }

.im-textarea {
    min-height: 96px;
    resize: none;
}

.im-field-help {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .76rem;
    color: #64748b;
}

.im-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 1.25rem 0;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 640px) {
    .im-dialog {
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
    }

    .im-modal {
        max-height: 94vh;
    }

    .im-modal__header,
    .im-modal__body,
    .im-modal__footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .quick-send-audience-card {
        flex-direction: column;
    }

    .im-modal__footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

        .im-modal__footer .rz-button {
            width: 100%;
        }
}
