/* -------------------------------------------------------------------------
   #sweetalert — the popup ModelSuccessDanger() drives for every success and
   error message in the portal.

   Scoped by ID on purpose. Modal_V4.css styles .modal-sweet, which a dozen
   other dialogs also wear, so restyling that class would redesign all of them
   at once. An ID selector also outranks every .modal-sweet rule without
   needing !important.
   ------------------------------------------------------------------------- */

/* rtl_V2.css sets "* { direction: rtl; text-align: right }". A universal
   selector matches every descendant directly, so centring the card is not
   enough - nothing inherits it. */
#sweetalert .modal-content,
#sweetalert .modal-content * {
    text-align: center;
}

#sweetalert .modal-dialog {
    width: 440px;
    max-width: calc(100% - 24px);
    box-shadow: none; /* .modal-sweet paints a hard offset drop shadow */
}

#sweetalert .modal-content {
    position: relative;
    overflow: hidden;
    direction: rtl;
    padding: 0 0 28px;
    border: none;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 28px 64px rgba(9, 35, 48, 0.32), 0 2px 10px rgba(9, 35, 48, 0.10);
    font-size: 15px;
}

    /* Status strip across the top of the card. ModelSuccessDanger puts
       sweet-danger or sweet-success on #sweetalert; danger is the default so
       an unclassed card still reads as a problem rather than as an all-clear. */
    #sweetalert .modal-content::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: linear-gradient(90deg, #d63b57 0%, #f0836f 100%);
    }

#sweetalert.sweet-success .modal-content::before {
    background: linear-gradient(90deg, #1f9254 0%, #8dc63f 100%);
}

#sweetalert .modal-header {
    position: relative;
    display: block;
    padding: 34px 26px 0;
    border-bottom: none;
}

#sweetalert .close {
    position: absolute;
    top: 14px;
    right: 16px;
    left: auto;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f6f8;
    color: #8ba7b3;
    font-size: 21px;
    line-height: 30px;
    opacity: 1;
    text-shadow: none;
    transition: background 0.2s, color 0.2s;
}

    #sweetalert .close:hover,
    #sweetalert .close:focus {
        background: #e2ecf0;
        color: #43606d;
        opacity: 1;
    }

/* Filled badge rather than the thin outlined ring. */
#sweetalert .icon-box-danger,
#sweetalert .icon-box-success {
    width: 88px;
    height: 88px;
    margin: 0 auto;
    border: none;
    border-radius: 50%;
}

#sweetalert .icon-box-danger {
    background: linear-gradient(135deg, #fdeef0 0%, #fadde2 100%);
}

#sweetalert .icon-box-success {
    background: linear-gradient(135deg, #eaf7ef 0%, #d7f0e1 100%);
}

    #sweetalert .icon-box-danger i,
    #sweetalert .icon-box-success i {
        display: inline-block;
        margin-top: 0;
        font-size: 44px;
        line-height: 88px;
    }

    #sweetalert .icon-box-danger i {
        color: #d63b57;
    }

    #sweetalert .icon-box-success i {
        color: #1f9254;
    }

/* .modal-sweet sets this to 40px, which turns a two word title into a
   headline and pushes the message that matters below the fold. */
#sweetalert .modal-title {
    margin: 22px 0 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
    color: #0e2c3a;
}

#sweetalert .modal-body {
    padding: 12px 30px 0;
    font-size: 15px;
    line-height: 1.9;
    color: #55727f;
}

    #sweetalert .modal-body label {
        display: block;
        margin: 0;
        font-weight: 400;
    }

    #sweetalert .modal-body strong {
        color: #0e2c3a;
        font-weight: 700;
    }

    #sweetalert .modal-body p:last-child {
        margin-bottom: 0;
    }

#sweetalert .modal-footer {
    display: block;
    padding: 24px 26px 0;
    border-top: none;
}

    #sweetalert .modal-footer .btn {
        min-width: 150px;
        min-height: 44px;
        margin: 0;
        padding: 11px 32px;
        border: none;
        border-radius: 12px;
        background: #0b6e8f;
        color: #ffffff;
        font-size: 15px;
        font-weight: 600;
        box-shadow: 0 6px 16px rgba(11, 110, 143, 0.28);
        transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    }

        /* Dismissing an error is not itself a destructive act, so the button
           stays neutral on both variants; the strip and the badge carry the
           status. */
        #sweetalert .modal-footer .btn:hover,
        #sweetalert .modal-footer .btn:focus {
            background: #095a76;
            box-shadow: 0 8px 20px rgba(11, 110, 143, 0.34);
            color: #ffffff;
        }

        #sweetalert .modal-footer .btn:active {
            transform: translateY(1px);
            box-shadow: 0 3px 10px rgba(11, 110, 143, 0.28);
        }

/* The client clock, moved out of the header. A timestamp is a footnote, not
   the first thing to read. */
#sweetalert .sweet-timestamp {
    margin: 24px 26px 0;
    padding-top: 15px;
    border-top: 1px solid #edf3f6;
    font-size: 12px;
    color: #9db3bd;
}

    /* The JS fallback wraps the stamp in bootstrap grid classes when the
       placeholder is missing; strip the gutters it brings. */
    #sweetalert .sweet-timestamp [class^="col-"] {
        padding: 0;
    }

    #sweetalert .sweet-timestamp .alert-light {
        padding: 0;
        border: none;
        background: none;
        color: inherit;
    }

@media (max-width: 480px) {
    #sweetalert .modal-content {
        border-radius: 16px;
        padding-bottom: 24px;
    }

    #sweetalert .modal-header {
        padding: 28px 18px 0;
    }

    #sweetalert .icon-box-danger,
    #sweetalert .icon-box-success {
        width: 76px;
        height: 76px;
    }

        #sweetalert .icon-box-danger i,
        #sweetalert .icon-box-success i {
            font-size: 38px;
            line-height: 76px;
        }

    #sweetalert .modal-title {
        font-size: 20px;
    }

    #sweetalert .modal-body {
        padding: 10px 18px 0;
        font-size: 14px;
    }

    #sweetalert .modal-footer {
        padding: 20px 18px 0;
    }

        #sweetalert .modal-footer .btn {
            width: 100%;
        }

    #sweetalert .sweet-timestamp {
        margin: 20px 18px 0;
    }
}
