html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5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bGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Client activation page */
.status {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

.status-ok {
    background-color: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.status-error {
    background-color: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5b8b4;
}

.token {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    padding: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.85rem;
}

.note {
    color: #555;
    font-size: 0.9rem;
}

/* Client sign-in / account */
.branch-badge {
    display: inline-block;
    background-color: var(--app-header, #03173d);
    color: #fff;
    border-radius: 1rem;
    padding: 0.25rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.field {
    margin: 1rem 0;
    max-width: 24rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.text-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.text-input:focus {
    outline: none;
    border-color: #03173d;
    box-shadow: 0 0 0 0.15rem rgba(3, 23, 61, 0.15);
}

.detail-list {
    margin: 1.25rem 0;
}

.detail-list dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
}

.detail-list dd {
    margin: 0 0 0.85rem 0;
    font-size: 1.05rem;
}

/* ---- Mobile bottom navigation ---- */
.bottom-nav {
    background-color: var(--app-surface, #fff);
    border-top-color: var(--app-border, #e3e3e3);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    background-color: #fff;
    border-top: 1px solid #e3e3e3;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav-item {
    color: var(--app-muted, #6b7280);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav-item.active {
    color: var(--app-header, #03173d);
    color: #03173d;
}

/* Centre button sits raised above the bar. */
.bottom-nav-home {
    position: relative;
}

.bottom-nav-home-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: -26px;
    border-radius: 50%;
    background-color: var(--app-header, #03173d);
    color: #fff;
    border: 4px solid var(--app-surface, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bottom-nav-home-circle svg {
    width: 24px;
    height: 24px;
}

.bottom-nav-home.active .bottom-nav-home-circle {
    background-color: var(--app-button, #1b3a7a);
}

/* ---- Balance and loan cards ---- */
.greeting {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.balance-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: linear-gradient(135deg, var(--app-header, #03173d) 0%, var(--app-button, #1b3a7a) 100%);
    color: #fff;
    border-radius: 0.9rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.balance-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
}

.balance-sub {
    font-size: 0.85rem;
    opacity: 0.85;
}

.section-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin: 1.25rem 0 0.75rem;
}

.loan-card {
    background-color: var(--app-surface, #fff);
    border-color: var(--app-border, #e3e3e3);
    color: var(--app-text, #212121);
    background-color: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.loan-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.loan-product {
    font-weight: 600;
}

.loan-balance {
    font-weight: 700;
    font-size: 1.1rem;
}

.loan-reference {
    font-size: 0.8rem;
    color: #777;
    margin-top: 0.15rem;
}

.loan-progress {
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    margin: 0.85rem 0 0.35rem;
    overflow: hidden;
}

.loan-progress-bar {
    height: 100%;
    background-color: var(--app-button, #1b3a7a);
}

.loan-progress-label {
    font-size: 0.78rem;
    color: #666;
}

.loan-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 0.85rem 0 0;
}

.loan-facts dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #777;
}

.loan-facts dd {
    margin: 0.1rem 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.loan-note {
    margin: 0.85rem 0 0;
    font-size: 0.88rem;
    color: #555;
}

.empty-state {
    background-color: #f7f7f7;
    border: 1px dashed #ccc;
    border-radius: 0.6rem;
    padding: 1.25rem;
    text-align: center;
    color: #666;
}

/* ---- Application status pills ---- */
.status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    white-space: nowrap;
}

.status-pill-approved {
    background-color: #e8f5e9;
    color: #1b5e20;
}

.status-pill-declined {
    background-color: #fdecea;
    color: #b71c1c;
}

.status-pill-review {
    background-color: #fff4e5;
    color: #8a5300;
}

.status-pill-submitted {
    background-color: #e8eefc;
    color: #1b3a7a;
}

/* ---- Notification bell (app header) ---- */
.bell {
    /* Pushed to the right so it sits opposite the logo. */
    margin-left: auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--app-header-text, #fff);
    cursor: pointer;
}

.bell:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.bell:disabled {
    cursor: default;
}

.bell svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Off state is dimmed as well as slashed, so it does not rely on colour alone. */
.bell-off {
    opacity: 0.55;
}

.bell-on {
    opacity: 1;
}

.bell-slash {
    stroke-width: 2;
}

.bell-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #2ecc71;
    border: 2px solid var(--app-header, #03173d);
}

/* ---- Notification list ---- */

/* The wrapper takes over the bell's old margin-left:auto so the panel can be positioned
   against it rather than against the header. */
.bell-wrap {
    margin-left: auto;
    position: relative;
}

.bell-wrap .bell {
    margin-left: 0;
}

/* An unread count, not a dot - the client should know how many are waiting. */
.bell-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--app-header, #03173d);
    box-sizing: content-box;
}

/* Catches a tap anywhere outside the panel. Transparent on purpose - a dimmed screen would
   read as a modal, and this is a dropdown. */
.bell-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
}

.bell-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 151;
    width: min(88vw, 340px);
    max-height: min(70vh, 460px);
    overflow-y: auto;
    background: var(--app-surface, #fff);
    color: var(--app-text, #212121);
    border: 1px solid var(--app-border, #e3e3e3);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.bell-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--app-border, #e3e3e3);
    font-weight: 700;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    background: var(--app-surface, #fff);
}

.bell-toggle {
    border: 1px solid var(--app-border, #e3e3e3);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.bell-toggle:disabled {
    opacity: 0.6;
    cursor: default;
}

.bell-toggle-blocked {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--app-muted, #6b7280);
    text-align: right;
}

.bell-empty {
    margin: 0;
    padding: 1.1rem 0.9rem;
    color: var(--app-muted, #6b7280);
    font-size: 0.85rem;
}

.bell-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bell-item {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--app-border, #e3e3e3);
    cursor: pointer;
}

.bell-item:last-child {
    border-bottom: none;
}

/* A left bar rather than a background wash, so it survives dark mode and colour blindness. */
.bell-item-unread {
    border-left: 3px solid var(--app-button, #1b3a7a);
    padding-left: calc(0.9rem - 3px);
}

.bell-item-title {
    font-weight: 700;
    font-size: 0.85rem;
}

.bell-item-body {
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: var(--app-text, #212121);
}

.bell-item-when {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: var(--app-muted, #6b7280);
}

/* ---- Install prompt ---- */
.install-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.install-card {
    background: var(--app-surface, #fff);
    color: var(--app-text, #212121);
    border-radius: 1rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 26rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.install-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.install-card p {
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.install-steps {
    margin: 0 0 1.25rem 1.1rem;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.install-actions {
    display: flex;
    gap: 0.75rem;
}

.install-actions .btn {
    flex: 1;
}

/* Sit above the bottom nav on small screens. */
@media (min-width: 30rem) {
    .install-backdrop {
        align-items: center;
    }
}

/* ---- Apply sliders ---- */
/* Amount and term are the only two things the client chooses, so they get the weight on the
   screen rather than sitting as small number boxes. */

.slider-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--app-button, #1b3a7a);
    margin: 0.2rem 0 0.35rem;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--app-border, #e3e3e3);
    outline: none;
    margin: 0;
}

/* A large thumb - this is driven by a thumb on a phone, not a mouse. */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--app-button, #1b3a7a);
    border: 3px solid var(--app-surface, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--app-button, #1b3a7a);
    border: 3px solid var(--app-surface, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.slider:focus-visible {
    outline: 2px solid var(--app-button, #1b3a7a);
    outline-offset: 4px;
}

.slider-ends {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--app-muted, #6b7280);
    margin-top: 0.3rem;
}

/* ---- Apply documents ---- */

.doc-required {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #8a5300;
    background-color: #fff4e5;
    border-radius: 1rem;
    padding: 0.1rem 0.5rem;
}

.doc-chosen {
    color: #1b5e20;
    font-weight: 600;
}
