/* ── Portal Dialog ─────────────────────────────────────────────────────
 * Generic reusable dialog component for the customer portal.
 * First consumer: FR-6127 (Pay Now modal replacements).
 * Uses Bootstrap 3 modal infrastructure.
 * ─────────────────────────────────────────────────────────────────── */

#portalDialog .modal-dialog {
    width: 588px;
    margin: 60px auto 0;
}

#portalDialog .modal-content {
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 30px;
    text-align: center;
    position: relative;
}

/* ── Close button ──────────────────────────────────────────────────── */

.portalDialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 19px;
    line-height: 1;
}

.portalDialog-close img {
    width: 100%;
    height: 100%;
}

/* ── Icon ──────────────────────────────────────────────────────────── */

.portalDialog-icon {
    width: 77px;
    height: 76px;
    margin: 0 auto 28px;
}

.portalDialog-icon img {
    width: 100%;
    height: 100%;
}

.portalDialog-icon:empty {
    display: none;
}

/* ── Title ─────────────────────────────────────────────────────────── */

.portalDialog-title {
    color: #1b1b1b;
    font-size: 19px;
    font-weight: bold;
    margin: 0 0 10px;
}

.portalDialog-title:empty {
    display: none;
}

/* ── Message ───────────────────────────────────────────────────────── */

.portalDialog-message {
    color: #1a1a1a;
    font-size: 14px;
    line-height: 21px;
    margin: 0 0 6px;
}

.portalDialog-subMessage {
    color: #525252;
    font-size: 14px;
    line-height: 21px;
    margin: 0 0 22px;
}

.portalDialog-subMessage:empty {
    display: none;
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.portalDialog-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.portalDialog-btn {
    min-width: 80px;
    height: 46px;
    border-radius: 22px;
    font-size: 15px;
    cursor: pointer;
    padding: 0 24px;
    line-height: 46px;
}

.portalDialog-btn--filled {
    background-color: #004c7e;
    color: #fbfcfd;
    border: 1px solid #004c7e;
}

.portalDialog-btn--filled:hover,
.portalDialog-btn--filled:focus {
    background-color: #003a61;
    border-color: #003a61;
    color: #fbfcfd;
}

.portalDialog-btn--outline {
    background-color: transparent;
    color: #004c7e;
    border: 1px solid #004c7e;
}

.portalDialog-btn--outline:hover,
.portalDialog-btn--outline:focus {
    background-color: rgba(0, 76, 126, 0.05);
    color: #003a61;
    border-color: #003a61;
}

/* ── Custom Content Slot ───────────────────────────────────────────── */

.portalDialog-customContent {
    display: none;
    text-align: left;
    margin: 14px 0 0;
}

/* ── Post-Transaction Save to Wallet ──────────────────────────────── */

.postSave-option {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    color: #313131;
    font-weight: normal;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.postSave-option input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.postSave-option--sub {
    padding-left: 22px;
}

.postSave-autopaySection {
    margin-top: 6px;
}

.postSave-consent {
    margin: 8px 22px 0 22px;
    padding: calc(1.4167em - 2px) 1.4167em calc(1.4167em - 5px);
    background: var(--portal-highlight-bg);
    border: 1px solid var(--portal-highlight-border);
    border-radius: 0.4em;
    line-height: 1.5;
    color: #4f4f4f;
}

.postSave-initials {
    width: 60px;
    text-align: center;
    background: #FFFFFF;
    border: 1px solid var(--portal-field-border);
    border-radius: 0.35em;
    margin: 0 6px 0 0;
    position: relative;
    top: 2px;
}

.postSave-initials:focus,
.postSave-initials:focus-visible {
    border: 1px solid var(--portal-highlight-border);
    outline: none;
}

.postSave-initials.invalid {
    border-color: #FF595A;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    #portalDialog .modal-dialog {
        width: auto;
        max-width: 90vw;
        margin: 20px auto 0;
    }

    #portalDialog .modal-content {
        padding: 20px;
    }
}
