/* ==========================================================================
   App modal - reusable eSmartX dialog shell

   Apply `WrapClassName="app-modal"` to an AntDesign Modal. Size modifiers keep
   dialog geometry reusable while the modal body remains feature-owned.
   ========================================================================== */

.app-modal .ant-modal {
    max-width: calc(100vw - 32px);
    padding-bottom: 24px;
}

.app-modal.app-modal--wide .ant-modal {
    width: min(800px, calc(100vw - 32px)) !important;
}

.app-modal.app-modal--tall .ant-modal {
    top: 24px;
    padding-bottom: 24px;
}

.app-modal .ant-modal-content {
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.app-modal .ant-modal-header {
    min-height: 56px;
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.app-modal .ant-modal-title {
    color: #111827;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

.app-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-modal-title__icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 0.875rem;
}

.app-modal-title__icon--success {
    background: color-mix(in srgb, #10b981 10%, white);
    color: #10b981;
}

.app-modal .ant-modal-body {
    padding: 0;
    background: #ffffff;
}

.app-modal .ant-modal-footer {
    margin: 0;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.app-modal .ant-modal-close {
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #6b7280;
    line-height: 1;
}

.app-modal .ant-modal-close-x {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.app-modal .ant-modal-close:hover,
.app-modal .ant-modal-close:focus-visible {
    background: #f5f5f7;
    color: #ea580c;
}

.app-modal .ant-modal-close:focus-visible {
    outline: 2px solid #ea580c;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .app-modal .ant-modal {
        top: 16px;
        max-width: calc(100vw - 24px);
        padding-bottom: 16px;
    }

    .app-modal.app-modal--wide .ant-modal {
        width: calc(100vw - 24px) !important;
    }

    .app-modal .ant-modal-header {
        min-height: 52px;
        padding: 12px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-modal .ant-modal,
    .app-modal .ant-modal-mask {
        animation: none !important;
        transition: none !important;
    }
}
