/* =========================================================
   PUBLIC/ASSETS/CSS/COMPONENTS/FORM-MODAL.CSS
   ========================================================= */

/* ==========================================================================
   MODAL BASE
   ========================================================================== */

.app-form-modal .modal-dialog {
    max-width: 860px;
}

.app-form-modal .modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
    overflow: hidden;
}

.app-form-modal .modal-body {
    padding: 14px;
    background: #f8fafc;
}

/* Scroll só quando a altura da tela realmente exigir */
@media (max-height: 720px) {
    .app-form-modal .modal-body {
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }
}

/* ==========================================================================
   FORM DENTRO DA MODAL
   ========================================================================== */

.app-form-modal .modal-form-page {
    margin: 0 !important;
    padding: 0 !important;
}

.app-form-modal .modal-form-box {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.app-form-modal .form-titlebar {
    margin-bottom: 10px;
    padding: 9px 12px;
    border-radius: 10px;
}

.app-form-modal .form-titlebar h4 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.2;
}

/* ==========================================================================
   ------------------------> VARIAÇÕES DE TAMANHO <------------------------
   ========================================================================== */
/* ==========================================================================
   TAMANHO DEFAULT
   ========================================================================== */
.app-form-modal .modal-dialog {
    max-width: 880px;
}

.app-form-modal .ql-container.ql-snow.app-quill-editor {
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
}

.app-form-modal .ql-container.ql-snow.app-quill-editor .ql-editor {
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
}

/* ==========================================================================
   VARIAÇÃO: TALL
   ========================================================================== */
.app-form-modal.app-form-modal-tall .modal-dialog {
    max-width: 1000px;
}

.app-form-modal.app-form-modal-tall .ql-container.ql-snow.app-quill-editor {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
}

.app-form-modal.app-form-modal-tall .ql-container.ql-snow.app-quill-editor .ql-editor {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
}

/* ==========================================================================
   VARIAÇÃO: XL
   ========================================================================== */
.app-form-modal.app-form-modal-xl .modal-dialog {
    max-width: 1120px;
}

.app-form-modal.app-form-modal-xl .ql-container.ql-snow.app-quill-editor {
    height: 240px !important;
    min-height: 240px !important;
    max-height: 240px !important;
}

.app-form-modal.app-form-modal-xl .ql-container.ql-snow.app-quill-editor .ql-editor {
    height: 240px !important;
    min-height: 240px !important;
    max-height: 240px !important;
}

/* ==========================================================================
   FIELDSETS
   ========================================================================== */

.app-form-modal .form-fieldset {
    margin-bottom: 10px !important;
    padding: 9px 12px 10px;
    border-radius: 10px;
    background: #ffffff;
}

.app-form-modal .form-fieldset legend {
    width: auto;
    float: none !important;
    display: inline-block;
    margin-bottom: 4px;
    padding: 0 6px;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1;
}

/* ==========================================================================
   LABELS / INPUTS
   ========================================================================== */

.app-form-modal .form-label {
    margin-bottom: 3px;
    font-size: .84rem;
    font-weight: 600;
}

.app-form-modal .form-control,
.app-form-modal .form-select {
    min-height: 30px;
    padding: 4px 8px;
    font-size: .88rem;
    line-height: 1.15;
}

.app-form-modal .mb-1 {
    margin-bottom: .25rem !important;
}

.app-form-modal .mb-2 {
    margin-bottom: .45rem !important;
}

.app-form-modal .mb-3 {
    margin-bottom: .60rem !important;
}

/* ==========================================================================
   QUILL DENTRO DA MODAL — OVERRIDE FINAL
   ========================================================================== */

.app-form-modal .ql-toolbar.ql-snow {
    padding: 5px 6px !important;
    border-radius: 7px 7px 0 0 !important;
    background: #ffffff !important;
}

.app-form-modal .ql-container.ql-snow.app-quill-editor {
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
    overflow: hidden !important;
    border-radius: 0 0 7px 7px !important;
    background: #ffffff !important;
}

.app-form-modal .ql-container.ql-snow.app-quill-editor .ql-editor {
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-size: .90rem !important;
    line-height: 1.25 !important;
}


/* ==========================================================================
   ACTIONS / BOTÕES
   ========================================================================== */

.app-form-modal .form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.app-form-modal .form-actions .pill,
.app-form-modal .form-actions a,
.app-form-modal .form-actions button {
    font-size: .80rem;
}


/* ==========================================================================
   EMAIL COMPOSE FORM
   ========================================================================== */

.app-form-modal .email-form-grid {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 7px 10px;
    align-items: center;
}

.app-form-modal .email-form-label {
    margin: 0;
    text-align: right;
    white-space: nowrap;
}

.app-form-modal .email-form-control {
    min-width: 0;
}

.app-form-modal .email-form-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.app-form-modal .email-form-actions > *:nth-child(1) {
    justify-self: start;
}

.app-form-modal .email-form-actions > *:nth-child(2) {
    justify-self: center;
}

.app-form-modal .email-form-actions > *:nth-child(3) {
    justify-self: end;
}

