/* ==========================================================================
   MAGNITUDE CMS - SYSTEM POPUP (jAlert / jConfirm / jPrompt)
   Same look as the Login page popups, with the title centred.
   The plugin (Scripts/Library/jAlert/jquery.alerts.js) appends
   #popup_overlay and #popup_container to <body> and does not position the
   dialog, so it is centred here.
   Loaded by Views/Shared/_Layout.cshtml (every CMS screen) and
   Views/Home/Login.cshtml.
   ========================================================================== */

/* ==========================================================================
   1. OVERLAY
   ========================================================================== */
body #popup_overlay {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.5) !important;
    opacity: 1 !important;
    backdrop-filter: blur(4px) !important;
}

/* ==========================================================================
   2. DIALOG
   ========================================================================== */
body #popup_container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 420px !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    color: #334155 !important;
}

/* Title: centred */
body #popup_title {
    margin: 0 !important;
    padding: 14px 20px !important;
    background: #F8FAFC !important;
    background-image: none !important;
    border: none !important;
    border-bottom: 1px solid #E2E8F0 !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #0F172A !important;
    text-align: center !important;
    cursor: default !important;
}

/* ==========================================================================
   3. MESSAGE
   ========================================================================== */
body #popup_content {
    margin: 0 !important;
    padding: 18px 20px !important;
    background: #FFFFFF !important;
    background-image: none !important;
    border: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    color: #334155 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body #popup_message {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
}

body #popup_prompt {
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    margin: 12px 0 0 0 !important;
    padding: 0 12px !important;
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    color: #0F172A !important;
}

body #popup_prompt:focus {
    border-color: #1E70E5 !important;
    box-shadow: 0 0 0 3px rgba(30, 112, 229, 0.15) !important;
    outline: none !important;
}

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */
body #popup_panel {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 16px 0 0 0 !important;
    text-align: right !important;
}

/* Long messages: AppUserView.js moves the buttons below the scrolling message */
body #popup_container > #popup_panel {
    margin: 0 !important;
    padding: 14px 20px !important;
    border-top: 1px solid #F1F5F9 !important;
}

body #popup_ok,
body #popup_cancel {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 84px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 22px !important;
    border-radius: 8px !important;
    background-image: none !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    cursor: pointer !important;
    transition: background 0.15s ease, filter 0.15s ease !important;
}

body #popup_ok {
    background: #1E70E5 !important;
    border: none !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(30, 112, 229, 0.3) !important;
}

body #popup_ok:hover,
body #popup_ok:focus {
    background: #1E70E5 !important;
    border: none !important;
    filter: brightness(0.92) !important;
    outline: none !important;
}

body #popup_cancel {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    color: #334155 !important;
    box-shadow: none !important;
}

body #popup_cancel:hover,
body #popup_cancel:focus {
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
    outline: none !important;
}

/* Confirm: Cancel first, OK on the right (same order as the Login popup) */
body #popup_cancel {
    order: 1 !important;
}

body #popup_ok {
    order: 2 !important;
}
