/* CardiTrack additions on top of the Aquiry template (assets/css). */

/* Brand mark stays #2490eb (the logo, the tint behind an avatar). Small text and any fill
   that carries white text use --ct-action #1b6db3: white on #2490eb is 3.35:1, and #2490eb
   as text on the page ground #f2f2f4 is 3.00:1. #1b6db3 is 4.83:1 on that ground and 5.41:1
   under white. Keep this block in step with CardiTrack.Admin/wwwroot/app.css. */
:root {
    --ct-action: #1b6db3;
    --ct-action-hover: #165a94;
    --bs-primary: #2490eb;
    --bs-primary-rgb: 36, 144, 235;
    --bs-primary-bg-subtle: rgba(36, 144, 235, .12);
    --bs-primary-border-subtle: rgba(36, 144, 235, .4);
}
:root, [data-bs-theme="light"] {
    --bs-primary-text-emphasis: #1b6db3;
    --bs-link-color: #1b6db3;
    --bs-link-color-rgb: 27, 109, 179;
    --bs-link-hover-color: #165a94;
    --bs-link-hover-color-rgb: 22, 90, 148;
    /* #8a92a4 on the page is 2.79:1. #67676b is 5.04:1 there and 5.63:1 on white. */
    --bs-secondary-color: #67676b;
    --bs-secondary-color-rgb: 103, 103, 107;
    --bs-success-text-emphasis: #2f7667;
    --bs-warning-text-emphasis: #7f6c3f;
    --bs-danger-text-emphasis: #af4343;
    --bs-info-text-emphasis: #5664a3;
}
[data-bs-theme="dark"] {
    --bs-primary-text-emphasis: #7bb8f2;
    --bs-link-color: #7bb8f2;
    --bs-link-color-rgb: 123, 184, 242;
    --bs-link-hover-color: #9ccaf6;
    --bs-link-hover-color-rgb: 156, 202, 246;
    --bs-secondary-color: rgba(242, 242, 244, 0.75);
    --bs-secondary-color-rgb: 242, 242, 244;
    /* Pick K2 (2026-11-24): the light inks above are set on :root, so without these the dark
       theme drew them too, 2.79-3.05:1 on its own tints. The same hues lifted: on the dark
       subtle grounds success 8.76:1, warning 8.52:1, danger 7.99:1, info 8.13:1. */
    --bs-success-text-emphasis: #6fd3bb;
    --bs-warning-text-emphasis: #e9c46a;
    --bs-danger-text-emphasis: #f29b9b;
    --bs-info-text-emphasis: #a3b0ee;
}
/* .text-primary is the brand blue with !important (3.00:1 on the page). Initials and icons use it. */
:root:not([data-bs-theme="dark"]) .text-primary { color: var(--ct-action) !important; }
[data-bs-theme="dark"] .text-primary { color: #7bb8f2 !important; }

/* The menu marks the current page itself (NavLink adds .active); the template only styles the
   .mm-active class its own script sets once at load. */
.sidebar-left #sidebar-menu ul.left-menu > li > a.active { color: var(--ct-action) !important; background-color: rgba(var(--bs-primary-rgb), .07); }
.sidebar-left #sidebar-menu ul.left-menu > li > a.active::before { opacity: 1; visibility: visible; }
.sidebar-left #sidebar-menu ul.left-menu > li > a.active i { color: var(--ct-action); }
[data-bs-theme="dark"] .sidebar-left #sidebar-menu ul.left-menu > li > a.active,
[data-bs-theme="dark"] .sidebar-left #sidebar-menu ul.left-menu > li > a.active i { color: #7bb8f2 !important; }

/* Small compatibility helpers for markup the pages share: a centred icon tile, a lifting card. */
.avatar-title { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-weight: 500; }
.card-animate { transition: transform .2s ease, box-shadow .2s ease; }
.card-animate:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(20, 34, 53, .12); }
.progress-lg { height: 1.25rem; }
@media (prefers-reduced-motion: reduce) { .card-animate { transition: none; } .card-animate:hover { transform: none; } }

/* The template's plain alerts are solid colour with white text (poor contrast on yellow, and loud
   for the many informational notes here); use Bootstrap's tinted style with readable text. */
.alert-primary, .alert-secondary, .alert-success, .alert-info, .alert-warning, .alert-danger { --bs-alert-link-color: inherit; }
.alert-primary { --bs-alert-color: var(--bs-primary-text-emphasis); --bs-alert-bg: var(--bs-primary-bg-subtle); --bs-alert-border-color: var(--bs-primary-border-subtle); }
.alert-secondary { --bs-alert-color: var(--bs-secondary-text-emphasis); --bs-alert-bg: var(--bs-secondary-bg-subtle); --bs-alert-border-color: var(--bs-secondary-border-subtle); }
.alert-success { --bs-alert-color: var(--bs-success-text-emphasis); --bs-alert-bg: var(--bs-success-bg-subtle); --bs-alert-border-color: var(--bs-success-border-subtle); }
.alert-info { --bs-alert-color: var(--bs-info-text-emphasis); --bs-alert-bg: var(--bs-info-bg-subtle); --bs-alert-border-color: var(--bs-info-border-subtle); }
.alert-warning { --bs-alert-color: var(--bs-warning-text-emphasis); --bs-alert-bg: var(--bs-warning-bg-subtle); --bs-alert-border-color: var(--bs-warning-border-subtle); }
.alert-danger { --bs-alert-color: var(--bs-danger-text-emphasis); --bs-alert-bg: var(--bs-danger-bg-subtle); --bs-alert-border-color: var(--bs-danger-border-subtle); }

/* Buttons, links and label badges. The template paints badge text with the same bright fill it
   uses for a solid background, so "Payment due" was #f4d078 on a tint of itself (1.40:1).
   Light theme uses a darker ink of the same hue; dark theme keeps the template's light inks.
   Keep this block in step with CardiTrack.Admin/wwwroot/app.css. */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--ct-action);
    --bs-btn-border-color: var(--ct-action);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ct-action-hover);
    --bs-btn-hover-border-color: var(--ct-action-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--ct-action-hover);
    --bs-btn-active-border-color: var(--ct-action-hover);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--ct-action);
    --bs-btn-disabled-border-color: var(--ct-action);
}
.btn-outline-primary, .btn-label-primary { --bs-btn-color: var(--ct-action); --bs-btn-border-color: var(--ct-action); }
.btn-outline-primary { --bs-btn-hover-bg: var(--ct-action); --bs-btn-hover-border-color: var(--ct-action); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--ct-action); --bs-btn-active-color: #fff; }
.btn-label-primary { --bs-btn-hover-bg: var(--ct-action); --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-label-primary { --bs-btn-color: #7bb8f2; --bs-btn-border-color: #7bb8f2; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-hover-bg: var(--ct-action); --bs-btn-hover-border-color: var(--ct-action); --bs-btn-hover-color: #fff; }
:root:not([data-bs-theme="dark"]) .badge-label-success { color: #2f7667; }
:root:not([data-bs-theme="dark"]) .badge-label-warning { color: #7f6c3f; }
:root:not([data-bs-theme="dark"]) .badge-label-danger { color: #af4343; }
:root:not([data-bs-theme="dark"]) .badge-label-info { color: #5664a3; }
:root:not([data-bs-theme="dark"]) .text-success { color: #2f7667 !important; }
:root:not([data-bs-theme="dark"]) .text-warning { color: #7f6c3f !important; }
:root:not([data-bs-theme="dark"]) .text-danger { color: #af4343 !important; }
:root:not([data-bs-theme="dark"]) .text-info { color: #5664a3 !important; }

/* Toasts were white on the template fills (warning 1.49:1). Same tinted treatment as alerts. */
.ct-toast-success { background: #e4f6f3; color: #2f7667; }
.ct-toast-warning { background: #fdf8eb; color: #7f6c3f; }
.ct-toast-danger { background: #ffe7e7; color: #af4343; }
.ct-toast-info { background: #eaedfa; color: #5664a3; }

/* 44px is the web target. Links that sit in a sentence stay inline; icon buttons get a square. */
.btn:not(.btn-link):not(.dropdown-item) { min-height: 44px; }
.btn-sm:not(.btn-link), .btn-group-sm > .btn { min-height: 44px; }
.dropdown-item { min-height: 44px; }
.btn-icon { min-width: 44px; }
.btn-close { width: 44px; height: 44px; padding: 0; background-size: 16px; border-radius: 8px; }
.btn-close:hover { background-color: rgba(0, 0, 0, .06); }
[data-bs-theme="dark"] .btn-close:hover { background-color: rgba(255, 255, 255, .08); }

/* The template's focus ring is a 25% purple shadow, about 1.9:1 on white. A 2px action-blue
   outline clears 3:1 on the page and on white. app.min.css sets `button, a { outline: none
   !important }`, so the keyboard ring needs the same flag and a :focus-visible selector. */
button:focus-visible, a:focus-visible,
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible,
.form-check-input:focus-visible, .nav-link:focus-visible, .page-link:focus-visible, .dropdown-item:focus-visible {
    outline: 2px solid var(--ct-action) !important; outline-offset: 2px; box-shadow: none;
}
[data-bs-theme="dark"] button:focus-visible, [data-bs-theme="dark"] a:focus-visible,
[data-bs-theme="dark"] .btn:focus-visible, [data-bs-theme="dark"] .form-control:focus-visible,
[data-bs-theme="dark"] .form-select:focus-visible, [data-bs-theme="dark"] .form-check-input:focus-visible,
[data-bs-theme="dark"] .nav-link:focus-visible, [data-bs-theme="dark"] .dropdown-item:focus-visible {
    outline-color: #7bb8f2 !important;
}

/* A signed-out visitor sees the landing and a Sign in button, not the menu bar. The menu stays in
   the DOM (the template's script binds to it at start-up); this only hides it, and gives back the
   space the horizontal layout reserves for it. */
.ct-signed-out .sidebar-left, .ct-signed-out .sidebar-btn { display: none !important; }
@media (min-width: 992px) {
    [data-layout="horizontal"] .ct-signed-out .main-content .page-content { padding-top: calc(var(--bs-app-header-height) + 16px); }
}
/* On a phone the four-item menu drops down as a panel; the template sizes it for a long menu. */
@media (max-width: 991.98px) {
    [data-layout="horizontal"] .sidebar-left.horizontal-sidebar { height: auto; max-height: 320px; box-shadow: 0 6px 16px rgba(20, 34, 53, .12); }
}

/* Privacy choices (#1578): the RUM consent bar sits over the foot of the page at every width, and
   the footer's "Privacy choices" button reads as one of its links. The footer's fixed height is
   released so its links can wrap onto a phone's narrow width. */
.ct-rum-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; padding: 0 12px 12px; }
/* The template's cards are transparent and shadowless; this one floats over the page. */
.ct-rum-bar .card {
    max-width: 960px; margin: 0 auto; background-color: #fff;
    border: 1px solid #e9ebec; box-shadow: 0 4px 24px rgba(0, 0, 0, .15) !important;
}
[data-bs-theme="dark"] .ct-rum-bar .card { background-color: #212529; border-color: #2a4562; }
.ct-footer { height: auto; min-height: 60px; }
.ct-footer-link { font-size: inherit; text-decoration: none; vertical-align: baseline; }
.ct-footer-link:hover { text-decoration: underline; }
/* On a phone the footer's columns stack and its links wrap, so the page keeps more room below. */
@media (max-width: 575.98px) {
    [data-layout="horizontal"] .page-content { padding-bottom: 150px; }
}

/* Loading placeholder before the runtime starts, and the brand logo on a dark topbar. */
.loading { display: flex; align-items: center; justify-content: center; height: 100vh; color: #56657a; }

/* The CardiTrack mark breathes while the app starts or checks the sign-in: a slow grow and fade
   with three dots under it. Centred in the page area (or the whole window before the app loads). */
.ct-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 60vh; }
.loading .ct-loader { min-height: 0; }
.ct-loader-mark { width: 64px; height: auto; animation: ct-breathe 2.4s ease-in-out infinite; }
.ct-loader-dots span { display: inline-block; width: 6px; height: 6px; margin: 0 3px; border-radius: 50%; background: #2490eb; animation: ct-dot 1.2s ease-in-out infinite; }
.ct-loader-dots span:nth-child(2) { animation-delay: .2s; }
.ct-loader-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ct-breathe { 0%, 100% { transform: scale(.94); opacity: .8; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes ct-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
/* Held still for visitors who ask for less motion (the rule further down would only shorten an
   infinite animation into a flicker). */
@media (prefers-reduced-motion: reduce) {
    .ct-loader-mark, .ct-loader-dots span { animation: none !important; }
}
.ct-logo-pill { background: #fff; border-radius: 8px; padding: 3px 8px; }
.ct-logo-mark { background: transparent; padding: 0; }
.ct-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: rgba(36, 144, 235, .12); color: var(--ct-action); font-weight: 600; font-size: .8rem; }
[data-bs-theme="dark"] .ct-avatar { color: #7bb8f2; }
.ct-avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.ct-page { max-width: 1100px; }
.card-title { font-size: 1rem; font-weight: 600; }

/* Customer landing: hero and the phone-screenshot showcase. */
.ct-hero { padding-top: 8px; }
.ct-logo { display: block; max-width: 260px; width: 60%; height: auto; margin: 0 auto 1.25rem; }
/* Signed-out page (Authentication.razor, LogOutSucceeded): the hero, narrowed and set down from the top bar.
   Not .ct-signed-out — MainLayout puts that on #layout-wrapper for every signed-out visitor. */
.ct-signed-out-panel { max-width: 560px; margin: 0 auto; padding-top: 48px; }
/* The logo beats: a lub and a smaller dub, then rest, about 70 bpm. Scaled from the centre so the
   wordmark stays put either side of it. Still for anyone who asks for less motion. */
.ct-logo-beat { animation: ct-heartbeat 1.7s ease-in-out infinite; transform-origin: 50% 55%; }
@keyframes ct-heartbeat {
    0%, 40%, 100% { transform: scale(1); }
    12% { transform: scale(1.05); }
    22% { transform: scale(1); }
    30% { transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) { .ct-logo-beat { animation: none; } }
/* Coverflow carousel of the app screenshots: a large centre card flanked by angled side cards.
   The centre card is --cf-card wide (capped at 28vh so a short window is not a full-height stage)
   and the flanks are scaled from it (Home.razor). The stage height is that width times the
   screenshots' 2.164 aspect ratio, plus room for the drop shadow, and the stage clips so the
   far cards never widen the page. */
.ct-cf { position: relative; margin-top: 8px; }
.ct-cf-stage {
    --cf-card: min(315px, 28vh);
    position: relative;
    width: 100%;
    max-width: 940px;
    height: calc(var(--cf-card) * 2.164 + 80px);
    margin: 0 auto;
    perspective: 1400px;
    transform-style: preserve-3d;
    overflow: hidden;
}
.ct-cf-item {
    position: absolute;
    top: 24px;
    left: 50%;
    width: var(--cf-card);
    height: auto;
    border-radius: 26px;
    box-shadow: 0 14px 36px rgba(20, 34, 53, 0.22);
    cursor: pointer;
    user-select: none;
    transform-origin: center center;
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.5s ease;
    will-change: transform, opacity;
}
.ct-cf-nav {
    position: absolute;
    top: 46%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--ct-action);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 2px 12px rgba(20, 34, 53, 0.18);
    transition: background 0.2s ease, color 0.2s ease;
}
.ct-cf-nav:hover { background: var(--ct-action); color: #fff; }
.ct-cf-prev { left: 8px; }
.ct-cf-next { right: 8px; }
.ct-cf-dots { display: flex; gap: 9px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
/* The visible mark stays a 10px dot. The button is the 44px target around it. */
.ct-cf-dot {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.ct-cf-dot::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(20, 34, 53, 0.45);
    transform: translate(-50%, -50%);
}
.ct-cf-dot:hover::after, .ct-cf-dot.active::after { background: var(--ct-action); }
.ct-cf-dot.active::after { width: 12px; height: 12px; }
@media (max-width: 600px) {
    .ct-cf-stage { --cf-card: min(200px, 52vw); height: calc(var(--cf-card) * 2.164 + 56px); }
    .ct-cf-item { top: 16px; width: var(--cf-card); border-radius: 18px; }
    .ct-cf-nav { width: 44px; height: 44px; font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Focus ring after FocusOnNavigate lands on the page heading, and the runtime error bar (hidden until Blazor shows it). */
h1:focus { outline: 2px solid var(--ct-action); outline-offset: 4px; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 0.6rem 1.25rem 0.7rem; background: #ffffe5; border-top: 1px solid #d9c700; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
