/* Pop-ups across the app: the message box (errors/flash_message), every older Bootstrap window, the older
   custom overlays (.popup-bg, .sla-modal) and the branded dialog that replaces the browser's alert/confirm
   (popups.js, window.seDialog). Windows already in the new style (co-, gb-, gbx-, ul-, ap-, pu, spx-up, wb-)
   are left alone. Loaded after style.min.css on every page. Smarty Ears brand: coral #F16B68, blue #3C9BD5, ink #202B46. */

:root {
    --pp-ink: #202B46; --pp-text: #43566a; --pp-muted: #6b7c90; --pp-blue: #3C9BD5; --pp-blue-dark: #2B7FB8; --pp-blue-soft: #e8f3fb;
    --pp-coral: #F16B68; --pp-coral-dark: #d9534f; --pp-line: #e3ebf2; --pp-green: #1f9d63;
    --pp-font: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ================= Message box ================= */
.flash-message { background: rgba(32, 43, 70, .38); backdrop-filter: blur(2px); }
.flash-message .centralize-wrapper { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 100%; padding: 16px; }
.flash-message div.centralize-inner { display: flex; justify-content: center; width: 100%; }
.flash-message div.centralize-content { margin: 0; }
.flash-message .centralize-content {
    position: relative; width: 100%; max-width: 420px; padding: 30px 26px 24px; border-radius: 22px; background: #fff;
    box-shadow: 0 24px 60px rgba(32, 43, 70, .25); font-family: var(--pp-font); color: var(--pp-ink) !important;
    animation: pp-pop .18s ease-out;
}
.flash-message .centralize-content p { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.45; color: var(--pp-ink); }
.flash-message .flash-icon { width: 58px; height: 58px; margin: 0 auto 14px; border: 0 !important; border-radius: 18px; font-size: 25px; line-height: 58px; }
.flash-message .flash-success .flash-icon { background: #e6f6ee; color: var(--pp-green); }
.flash-message .flash-error .flash-icon { background: #fdecec; color: #c8423f; }
.flash-message .flash-warning .flash-icon { background: #fff4dc; color: #c98a08; }
.flash-message .flash-confirmation .flash-icon { background: var(--pp-blue-soft); color: var(--pp-blue-dark); }
.flash-message .close.flash-close {
    position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: #f0f4f8; color: var(--pp-muted);
    font-size: 22px; line-height: 34px; text-align: center; opacity: 1; text-shadow: none;
}
.flash-message .close.flash-close:hover { background: var(--pp-line); color: var(--pp-ink); }
/* Confirm / Cancel when the box asks a question */
.flash-message .flash-confirmation .flash-removable { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.flash-message .flash-confirmation .flash-removable > p { flex-basis: 100%; margin-bottom: 8px; }
.flash-message .flash-confirmation .flash-icon { flex-basis: 58px; }
.flash-message .flash-confirmation .flash-icon + p { margin-top: 0; }
.flash-message .flash-confirm.btn, .flash-message a.flash-close.btn {
    min-width: 120px; padding: 10px 20px; border: 0; border-radius: 999px; font-family: var(--pp-font); font-size: 15px; font-weight: 800; box-shadow: none;
}
.flash-message .flash-confirm.btn { order: 3; background: var(--pp-coral) !important; color: #fff !important; }
.flash-message a.flash-close.btn { order: 2; background: #fff !important; color: var(--pp-blue-dark) !important; border: 1px solid var(--pp-line); }
.flash-message .flash-confirmation .flash-removable > .close { order: 0; }
/* Success: a short toast at the top that fades on its own (popups.js adds .is-toast). */
.flash-message.is-toast { top: 16px; height: auto; background: transparent; backdrop-filter: none; pointer-events: none; }
.flash-message.is-toast .centralize-wrapper { position: static; height: auto; min-height: 0; padding: 0 16px; }
.flash-message.is-toast .centralize-content {
    display: flex !important; align-items: center; gap: 14px; max-width: 520px; padding: 14px 52px 14px 16px; text-align: left; pointer-events: auto;
    border: 1px solid #cfeedd; animation: pp-drop .22s ease-out;
}
.flash-message.is-toast .flash-icon { flex: 0 0 auto; width: 40px; height: 40px; margin: 0; border-radius: 12px; font-size: 18px; line-height: 40px; text-align: center; }
.flash-message.is-toast .centralize-content p { font-size: 15px; }
.flash-message.is-toast .close.flash-close { top: 50%; transform: translateY(-50%); }
@keyframes pp-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pp-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ================= Older Bootstrap windows ================= */
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-dialog {
    display: flex; align-items: center; min-height: calc(100% - 3.5rem); margin: 1.75rem auto !important;
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-content {
    width: 100%; border: 0 !important; border-radius: 20px; overflow: hidden; background: #fff;
    box-shadow: 0 24px 60px rgba(32, 43, 70, .25); font-family: var(--pp-font); color: var(--pp-text);
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-header {
    align-items: center; padding: 20px 24px 6px; border: 0 !important; background: #fff !important; color: var(--pp-ink);
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-title {
    margin: 0; font-family: var(--pp-font); font-size: 19px; font-weight: 900; color: var(--pp-ink) !important;
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-header .close,
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-content > .close {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: -4px -6px 0 auto; padding: 0 !important;
    border-radius: 50%; background: #f0f4f8; color: var(--pp-muted); font-size: 22px; line-height: 1; opacity: 1; text-shadow: none;
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-header .close:hover { background: var(--pp-line); color: var(--pp-ink); }
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-body { padding: 12px 24px; font-size: 15.5px; line-height: 1.5; }
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .confirmation-text,
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-body > p:first-child {
    font-size: 16px; font-weight: 700; color: var(--pp-ink);
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-footer {
    flex-wrap: wrap; gap: 8px; padding: 8px 24px 22px; border: 0 !important; background: #fff;
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-footer > * { margin: 0; }
/* Buttons: pills in the brand colors. Danger = coral, main = blue, the rest quiet. */
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .btn {
    padding: 9px 20px; border-radius: 999px; font-family: var(--pp-font); font-size: 14.5px; font-weight: 800; box-shadow: none; text-transform: none;
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .btn-danger { background: var(--pp-coral); border-color: var(--pp-coral); color: #fff; }
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .btn-danger:hover { background: var(--pp-coral-dark); border-color: var(--pp-coral-dark); }
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) :is(.btn-success, .btn-info, .btn-primary) { background: var(--pp-blue); border-color: var(--pp-blue); color: #fff; }
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) :is(.btn-success, .btn-info, .btn-primary):hover { background: var(--pp-blue-dark); border-color: var(--pp-blue-dark); }
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) :is(.btn-secondary, .btn-default, .btn-light, .btn-outline-info, .btn-outline-secondary, .btn-outline-primary, .btn-warning) {
    background: #fff; border: 1px solid var(--pp-line); color: var(--pp-blue-dark);
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) :is(.btn-secondary, .btn-default, .btn-light, .btn-outline-info, .btn-outline-secondary, .btn-outline-primary, .btn-warning):hover { border-color: var(--pp-blue); background: #f7fbfe; }
/* Fields */
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .form-control {
    min-height: 42px; border: 1px solid #d7e2eb; border-radius: 12px; font-family: var(--pp-font); color: var(--pp-ink);
}
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .form-control:focus { border-color: var(--pp-blue); box-shadow: 0 0 0 4px rgba(60, 155, 213, .16); }
.modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) label { font-weight: 800; color: var(--pp-ink); }
.modal-backdrop.show { background: var(--pp-ink); opacity: .4; }

/* ================= Older custom overlays (.popup-bg, .sla-modal) ================= */
.popup-bg:not(.wb-overlay), .sla-modal:not(.spx-up) { background: rgba(32, 43, 70, .45) !important; backdrop-filter: blur(2px); }
.popup-bg:not(.wb-overlay) .popup-in, .sla-modal:not(.spx-up) .popup-in {
    max-width: 560px; border-radius: 22px !important; border: 0 !important; background: #fff; box-shadow: 0 24px 60px rgba(32, 43, 70, .25);
    font-family: var(--pp-font); color: var(--pp-text);
}
.popup-bg:not(.wb-overlay) .popup-in h1, .popup-bg:not(.wb-overlay) .popup-in h2, .popup-bg:not(.wb-overlay) .popup-in h3,
.sla-modal:not(.spx-up) h1, .sla-modal:not(.spx-up) h2, .sla-modal:not(.spx-up) h3 { font-family: var(--pp-font); font-weight: 900; color: var(--pp-ink); }
.popup-bg:not(.wb-overlay) .btn, .sla-modal:not(.spx-up) .btn, .sla-modal:not(.spx-up) button:not(.close):not(.spx-up-close) {
    border-radius: 999px; font-family: var(--pp-font); font-weight: 800;
}
.popup-bg:not(.wb-overlay) .form-control, .sla-modal:not(.spx-up) input:not([type=checkbox]):not([type=radio]), .sla-modal:not(.spx-up) select {
    min-height: 42px; border: 1px solid #d7e2eb; border-radius: 12px;
}

/* ================= Branded dialog (popups.js: seDialog.alert / seDialog.confirm) ================= */
.pp-dialog { position: fixed; inset: 0; z-index: 1000000000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(32, 43, 70, .38); backdrop-filter: blur(2px); font-family: var(--pp-font); }
.pp-dialog-card { width: 100%; max-width: 420px; padding: 26px 24px 22px; border-radius: 22px; background: #fff; text-align: center;
    box-shadow: 0 24px 60px rgba(32, 43, 70, .25); animation: pp-pop .18s ease-out; }
.pp-dialog-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 12px; border-radius: 18px; font-size: 24px; }
.pp-dialog.is-info .pp-dialog-icon { background: var(--pp-blue-soft); color: var(--pp-blue-dark); }
.pp-dialog.is-error .pp-dialog-icon { background: #fdecec; color: #c8423f; }
.pp-dialog.is-success .pp-dialog-icon { background: #e6f6ee; color: var(--pp-green); }
.pp-dialog.is-warn .pp-dialog-icon { background: #fff4dc; color: #c98a08; }
.pp-dialog-title { margin: 0 0 6px; font-size: 18px; font-weight: 900; color: var(--pp-ink); }
.pp-dialog-text { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--pp-text); white-space: pre-line; }
.pp-dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.pp-dialog-actions button { min-width: 120px; padding: 10px 20px; border-radius: 999px; font-size: 15px; font-weight: 800; cursor: pointer; }
.pp-dialog-ok { border: 0; background: var(--pp-blue); color: #fff; }
.pp-dialog-ok.is-danger { background: var(--pp-coral); }
.pp-dialog-cancel { border: 1px solid var(--pp-line); background: #fff; color: var(--pp-blue-dark); }
.pp-dialog-actions button:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(60, 155, 213, .3); }

@media (max-width: 575px) {
    .modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-dialog { margin: 1rem !important; min-height: calc(100% - 2rem); }
    .modal:not(.co-modal):not(.gbx-modal):not(.gb-modal):not(.ul-modal):not(.ap-modal):not(.pu) .modal-footer .btn { flex: 1; }
}

/* Toast: icon and text side by side */
.flash-message.is-toast .flash-removable { position: static; display: flex; align-items: center; gap: 14px; width: 100%; }
.flash-message.is-toast .flash-removable > p { flex: 1; text-align: left; }
.flash-message.is-toast .flash-removable > .close.flash-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Pop-up content (pm-*): the inside of the older pop-ups ----------
   <div class="pm"> icon, title, text, optional box or field, actions. Buttons keep their old ids/classes for the JS. */
.modal .pm { position: relative; padding: 24px 24px 20px; color: #202B46; font-family: Lato, "Source Sans Pro", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; text-align: left; }
.modal .pm-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f2f5f8; color: #6b7c90; font-size: 15px; line-height: 34px; text-align: center; cursor: pointer; padding: 0; opacity: 1; text-shadow: none; }
.modal .pm-close:hover { background: #e6edf3; color: #202B46; }
.modal .pm-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 0 12px; background: #e8f3fb; color: #2B7FB8; }
.modal .pm-icon.is-danger { background: #fdecec; color: #c8423f; }
.modal .pm-icon.is-warn { background: #fff1d6; color: #8a5d00; }
.modal .pm-icon.is-ok { background: #eaf7f0; color: #17734a; }
.modal .pm-duck { width: 72px; height: auto; margin: 0 0 8px; }
.modal .pm-title { font-size: 20px; font-weight: 900; line-height: 1.25; margin: 0 0 6px; padding-right: 30px; color: #202B46; }
.modal .pm-text { font-size: 15px; line-height: 1.55; color: #43566a; margin: 0 0 12px; }
.modal .pm-note { font-size: 13px; line-height: 1.5; color: #6b7c90; margin: 10px 0 0; }
.modal .pm-note a, .modal .pm-text a { color: #2B7FB8; font-weight: 700; }
.modal .pm-box { background: #f6f9fc; border: 1px solid #e3ebf2; border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; font-size: 14px; color: #43566a; }
.modal .pm-box strong { display: block; color: #202B46; margin-bottom: 4px; }
.modal .pm-box ul { margin: 0; padding-left: 18px; }
.modal .pm-box li { margin: 3px 0; }
.modal .pm-field { margin: 4px 0 6px; }
.modal .pm-field label { display: block; font-size: 13px; font-weight: 800; color: #43566a; margin-bottom: 6px; }
.modal .pm-field input, .modal .pm-field select, .modal .pm-field textarea { width: 100%; border: 1px solid #d5e0ea; border-radius: 10px; padding: 10px 12px; font-size: 15px; color: #202B46; background: #fff; height: auto; }
.modal .pm-field textarea { min-height: 160px; resize: vertical; }
.modal .pm-field input:focus, .modal .pm-field select:focus, .modal .pm-field textarea:focus { outline: none; border-color: #3C9BD5; box-shadow: 0 0 0 3px rgba(60, 155, 213, .15); }
.modal .pm-error { color: #c8423f; font-weight: 700; font-size: 13px; min-height: 0; }
.modal .pm-error:empty { display: none; }
.modal .pm-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal .pm-btn { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 800; font-size: 14px; background: #3C9BD5; color: #fff; cursor: pointer; line-height: 1.2; width: auto; margin: 0; }
.modal .pm-btn:hover { filter: brightness(.95); color: #fff; }
.modal .pm-btn.is-danger { background: #F16B68; }
.modal .pm-btn.is-ghost { background: #fff; color: #2B7FB8; border: 1px solid #cfe0ee; }
.modal .pm-btn.is-ghost:hover { background: #f2f8fd; color: #2B7FB8; }
@media (max-width: 480px) { .modal .pm-actions { flex-direction: column-reverse; } .modal .pm-btn { width: 100%; } }

/* ---------- Cancel my plan (cp-*): two-step save attempt ---------- */
.modal .cp-dialog { max-width: 560px; }
.modal .cp-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-right: 30px; }
.modal .cp-duck { width: 76px; height: auto; flex: 0 0 auto; }
.modal .cp-hero .pm-title { margin: 0; font-size: 22px; }
.modal .cp-eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #F16B68; }
.modal .cp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.modal .cp-stats > div { background: linear-gradient(160deg, #f2f8fd, #fff5f4); border: 1px solid #e3ebf2; border-radius: 14px; padding: 12px 8px; text-align: center; }
.modal .cp-stats strong { display: block; font-size: 26px; font-weight: 900; color: #202B46; line-height: 1.1; }
.modal .cp-stats span { display: block; font-size: 12px; font-weight: 700; color: #6b7c90; margin-top: 2px; }
.modal .cp-lose { margin: 0 0 14px; font-size: 14px; color: #43566a; }
.modal .cp-lose p { margin: 0 0 6px; display: flex; gap: 8px; }
.modal .cp-x { color: #c8423f; font-weight: 900; flex: 0 0 auto; }
.modal .cp-offers-title { margin: 0 0 8px; font-size: 14px; font-weight: 900; color: #202B46; }
.modal .cp-offers { display: grid; gap: 8px; }
.modal .cp-offer { display: block; width: 100%; text-align: left; border: 1px solid #d9e6f1; border-radius: 14px; padding: 11px 14px; background: #fff; color: #43566a; font-size: 13.5px; cursor: pointer; text-decoration: none; position: relative; transition: border-color .15s, box-shadow .15s; }
.modal .cp-offer:hover { border-color: #3C9BD5; box-shadow: 0 4px 14px rgba(32, 43, 70, .08); text-decoration: none; color: #43566a; }
.modal .cp-offer strong { display: block; font-size: 15px; color: #202B46; margin-bottom: 2px; }
.modal .cp-offer.is-best { border: 2px solid #3C9BD5; background: #f5fafe; }
.modal .cp-offer-tag { position: absolute; top: 10px; right: 12px; background: #17734a; color: #fff; font-size: 11.5px; font-weight: 900; border-radius: 999px; padding: 3px 10px; }
.modal .cp-actions { align-items: center; justify-content: space-between; }
.modal .cp-keep { padding: 12px 24px; font-size: 15px; background: #F16B68; box-shadow: 0 6px 16px rgba(241, 107, 104, .3); }
.modal .cp-keep .fa { margin-right: 4px; }
.modal .cp-link { border: 0; background: none; color: #6b7c90; font-size: 13.5px; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 6px 2px; }
.modal .cp-link:hover { color: #202B46; }
.modal .cp-reasons { display: grid; gap: 6px; margin: 0 0 10px; }
.modal .cp-reason { display: flex; align-items: center; gap: 10px; border: 1px solid #e3ebf2; border-radius: 12px; padding: 9px 12px; margin: 0; cursor: pointer; font-weight: 700; font-size: 14px; color: #202B46; }
.modal .cp-reason input { margin: 0; accent-color: #3C9BD5; }
.modal .cp-reason.is-picked { border-color: #3C9BD5; background: #f2f8fd; }
.modal .cp-answer { background: #fff8e8; border: 1px solid #f3dfa8; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; color: #43566a; }
.modal .cp-answer .fa { color: #a06d00; margin-right: 4px; }
@media (max-width: 520px) {
    .modal .cp-stats strong { font-size: 21px; }
    .modal .cp-duck { width: 56px; }
    .modal .cp-actions { flex-direction: column-reverse; align-items: stretch; }
    .modal .cp-actions .pm-btn { width: 100%; }
}
