
/*
 * CommuterPal site-wide theme for Alertify.js 0.3.10
 * Drop-in replacement for alertify.defaultSmallButtons.css.
 * Keep alertify.coreSmallButtons.css and alertify.min.withoutBounce.js unchanged.
 *
 * The original Alertify API, markup, alert/confirm/prompt callbacks and toast
 * notifications are preserved.
 */

.alertify,
.alertify-log {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Center the popup and allow it to grow with longer messages.
   Higher specificity overrides the top/width/margin/scroll values in core CSS. */
.alertify:not(.alertify-hidden) {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 540px;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    opacity: 1;
    visibility: visible;
}

.alertify {
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid rgba(15, 38, 74, .14);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(9, 24, 49, .32), 0 5px 20px rgba(9, 24, 49, .12);
    color: #19263a;
}

/* An actual backdrop: core CSS defines a white, transparent cover. */
.alertify-cover:not(.alertify-cover-hidden) {
    background: rgba(9, 20, 40, .58);
    opacity: 1;
    filter: none;
}

/* Reset the small cramped dialog values from core CSS. */
.alertify .alertify-dialog {
    padding: 30px 32px 24px;
}

.alertify .alertify-inner {
    text-align: left;
    color: #19263a;
    text-shadow: none;
}

/* Branded heading without changing alertify.alert() calls. */
.alertify .alertify-inner::before {
    content: "CommuterPal";
    display: block;
    color: #183f85;
    font-weight: 750;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: -.025em;
    padding-bottom: 15px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e7ecf4;
}

.alertify .alertify-message {
    margin: 0 0 26px;
    color: #253247;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.alertify .alertify-message strong,
.alertify .alertify-message b {
    color: #152d56;
}

.alertify .alertify-message a {
    color: #1655a1;
    text-decoration: underline;
}

.alertify .alertify-text-wrapper {
    margin: -5px 0 20px;
}

.alertify .alertify-text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    padding: 12px 14px;
    border: 1px solid #bbc9dc;
    border-radius: 9px;
    background: #fff;
    color: #152235;
    font-size: 16px;
    line-height: 1.4;
}

.alertify .alertify-text:focus {
    outline: 3px solid rgba(36, 104, 199, .20);
    border-color: #2468c7;
}

.alertify .alertify-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.alertify .alertify-button,
.alertify .alertify-button:hover,
.alertify .alertify-button:focus,
.alertify .alertify-button:active,
.alertify .alertify-button:visited {
    box-sizing: border-box;
    position: static;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 108px;
    min-height: 44px;
    margin: 0;
    padding: 10px 19px;
    border: 1px solid transparent;
    border-radius: 9px;
    background-image: none;
    box-shadow: none;
    text-shadow: none;
    text-decoration: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.alertify .alertify-button-ok,
.alertify .alertify-button-ok:visited {
    background-color: #225eaf;
    color: white;
}

.alertify .alertify-button-ok:hover {
    background-color: #184b90;
    color: white;
}

.alertify .alertify-button-cancel,
.alertify .alertify-button-cancel:visited {
    background-color: #eef2f8;
    border-color: #cbd6e5;
    color: #21334d;
}

.alertify .alertify-button-cancel:hover {
    background-color: #dfe7f2;
    color: #21334d;
}

.alertify .alertify-button:focus-visible {
    outline: 3px solid rgba(36, 104, 199, .28);
    outline-offset: 2px;
}

/* Keep the legacy log/toast API styled as it was. */
.alertify-log {
    background: rgba(0, 0, 0, .9);
    padding: 15px;
    border-radius: 4px;
    color: #fff;
    text-shadow: -1px -1px 0 rgba(0, 0, 0, .5);
}
.alertify-log-error {
    background: rgba(254, 26, 0, .9);
}
.alertify-log-success {
    background: rgba(92, 184, 17, .9);
}

@media only screen and (max-width: 680px) {
    .alertify:not(.alertify-hidden) {
        left: 50%;
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
        margin: 0;
    }
    .alertify .alertify-dialog {
        padding: 23px 20px 20px;
    }
    .alertify .alertify-inner::before {
        font-size: 20px;
        padding-bottom: 12px;
        margin-bottom: 14px;
    }
    .alertify .alertify-message {
        font-size: 16px;
        margin-bottom: 22px;
    }
    .alertify .alertify-button {
        min-width: 94px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alertify .alertify-button {
        transition: none;
    }
}
