/* Shared responsive safety layer for customer and administration pages. */
html { max-width: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }

img, picture, svg, video, canvas, iframe, object, embed { max-width: 100%; }
img, video, canvas { height: auto; }
iframe { border: 0; }

main, section, article, aside, header, footer, nav, form, fieldset,
.container, .container-fluid, .row,
[class*="-grid"], [class*="-layout"], [class*="-shell"] { min-width: 0; }

h1, h2, h3, h4, h5, h6, p, li, td, th, label, a, span, small, strong {
    overflow-wrap: break-word;
}

input, select, textarea, button { max-width: 100%; }
textarea { resize: vertical; }
pre, code, .responsive-overflow {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Added automatically around legacy tables by responsive-hardening.js. */
.responsive-table-shell, .table-responsive, .up-table-wrap, .table-scroll {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.responsive-table-shell > table, .table-responsive > table,
.up-table-wrap > table, .table-scroll > table {
    margin-bottom: 0;
    max-width: none;
}

.responsive-table-shell:focus, .table-responsive:focus,
.up-table-wrap:focus, .table-scroll:focus {
    outline: 3px solid rgba(30, 180, 220, .35);
    outline-offset: 2px;
}

.modal-dialog, dialog { max-width: calc(100vw - 24px); }
.modal-content {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Shared popup treatment across customer and administration experiences. */
.modal .modal-content {
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(10, 45, 60, .24);
}
.modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid #dceaf0;
}
.modal .modal-header h2, .modal .modal-header h3, .modal .modal-header h4, .modal .modal-header h5 {
    margin: 0;
    color: #123f50;
    font-weight: 800;
    line-height: 1.2;
}
.modal .modal-body { padding: 22px; color: #274b59; }
.modal .modal-footer {
    gap: 10px;
    padding: 16px 22px 22px;
    border-top: 1px solid #e5eef2;
}
.modal .close, .modal [aria-label="Close"] {
    transition: transform .18s ease, background-color .18s ease, color .18s ease;
}
.modal .close:hover, .modal [aria-label="Close"]:hover { transform: scale(1.05); }
.modal-backdrop.show { opacity: .58; }

.login-modal-dialog { width: min(94vw, 590px); }
.login-modal-card { overflow: hidden; }
.login-modal-header { background: linear-gradient(135deg, #effbfe 0%, #fff 70%); }
.login-modal-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.login-modal-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px;
    background: #20b7dc; color: #fff; font-size: 19px;
    box-shadow: 0 8px 20px rgba(32, 183, 220, .25);
}
.login-modal-kicker {
    display: block; margin-bottom: 4px; color: #0b7896;
    font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
}
.login-modal-heading .modal-title { font-size: clamp(20px, 3vw, 27px); }
.login-modal-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: 0 0 40px; padding: 0;
    border: 1px solid #cfe2e9; border-radius: 50%; background: #fff; color: #244e5e;
}
.login-modal-intro { margin: 0 0 18px; color: #5a7480; line-height: 1.55; }
.login-modal-card .form-group { margin-bottom: 16px; }
.login-modal-card label { margin-bottom: 7px; color: #183f50; font-size: 14px; font-weight: 800; }
.login-modal-card .form-control {
    min-height: 48px; border: 1px solid #c7dce5; border-radius: 11px;
    background: #fbfdfe; color: #173e4d; box-shadow: none;
}
.login-modal-card .form-control:focus {
    border-color: #20b7dc; background: #fff; box-shadow: 0 0 0 3px rgba(32, 183, 220, .16);
}
.login-label-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.login-label-row a, .login-account-link a { color: #067c9d; font-weight: 800; }
.login-account-link { margin: 3px 0 0; color: #647c86; }
.login-modal-error {
    margin-bottom: 16px; padding: 11px 13px; border: 1px solid #f0b7b7;
    border-radius: 10px; background: #fff3f3; color: #9d2525; font-weight: 700;
}
.login-modal-footer { display: grid !important; grid-template-columns: 1fr 1.35fr; }
.login-modal-footer .btn { min-height: 48px; margin: 0 !important; border-radius: 11px; font-weight: 800; }
.login-primary-btn { border: 1px solid #ec742b; background: #f47b2f; color: #fff; }
.login-primary-btn:hover, .login-primary-btn:focus { background: #dc651f; color: #fff; }
.login-secondary-btn { border: 1px solid #bcd4dd; background: #fff; color: #18495b; }
.login-secondary-btn:hover, .login-secondary-btn:focus { background: #eff8fb; color: #0b7896; }

@media (max-width: 991.98px) {
    .main-header .container, header .container, .header .container { max-width: 100% !important; }
    .modal-dialog { margin-left: auto; margin-right: auto; }
}

@media (max-width: 767.98px) {
    body { width: 100%; }
    .container, .container-fluid { max-width: 100%; }
    .main-header .container, header .container, .header .container {
        padding-left: 14px;
        padding-right: 14px;
        width: 100% !important;
    }

    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
    button, input[type="button"], input[type="submit"], input[type="reset"],
    .btn, [role="button"] { min-height: 44px; }

    .modal-dialog, dialog {
        margin: 10px auto;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        max-width: calc(100vw - 20px) !important;
        width: calc(100vw - 20px) !important;
    }

    .modal-body, .modal-header, .modal-footer { max-width: 100%; }
    .modal-footer { display: flex; flex-wrap: wrap; gap: 8px; }
    .modal-footer::before, .modal-footer::after { display: none; }
    .modal-footer .btn { flex: 1 1 140px; margin: 0; }

    .responsive-table-shell, .table-responsive, .up-table-wrap, .table-scroll {
        border-radius: 8px;
        scrollbar-width: thin;
    }
}

@media (max-width: 479.98px) {
    .modal-footer .btn { flex-basis: 100%; width: 100%; }
    .login-modal-heading { align-items: flex-start; }
    .login-modal-icon { width: 40px; height: 40px; flex-basis: 40px; }
    .login-modal-footer { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    body { overflow: visible; }
    .responsive-table-shell, .table-responsive, .up-table-wrap, .table-scroll {
        display: block;
        overflow: visible;
    }
}
