html {
    scrollbar-gutter: stable;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.match-height {
    align-items: stretch;
}

.login-container,
.vh-80 {
    min-height: 80vh;
}

.initialize-icon {
    font-size: 5rem;
}

.icon-xl {
    font-size: 3rem !important;
}

.icon-xxl {
    font-size: 5rem !important;
}

.role-card {
    width: 9.375rem;
    min-width: 7rem;
    flex: 1;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-grab {
    cursor: grab;
}

.program-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.program-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.opacity-80 {
    opacity: 0.8;
}

.line-height-tight {
    line-height: 1.3;
}

.pointer-events-none {
    pointer-events: none;
}

.whitespace-pre-wrap {
    white-space: pre-wrap;
}

.bg-transparent {
    background: transparent;
}

.font-monospace {
    font-family: monospace;
}

.text-transform-none {
    text-transform: none;
}

.fw-bold {
    font-weight: 700;
}

/* Branded full-screen loader: the Guided mark sits inside a progress ring that fills with real
   download progress (driven by the .NET runtime's onDownloadResourceProgress callback in App.razor).
   A faint indeterminate spinner holds the same ring position until the first progress report lands,
   then crossfades into the determinate ring so the hand-off reads as one continuous motion. On boot
   completion the whole splash fades out (revealing the app) before it's removed from the DOM. */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    background-color: var(--background);
    opacity: 1;
    transition: opacity 0.25s ease;
}

/* ThemeService applies the saved or system theme before this cover leaves. While WASM is still
   downloading, use the system preference so a dark-mode cold load does not start with a white flash. */
@media (prefers-color-scheme: dark) {
    html:not(.dark) .app-loader {
        --background: oklch(0.141 0.004 285.82);
        --primary: oklch(0.985 0 0);
        --muted-foreground: oklch(0.705 0.015 286.07);
    }
}

.app-loader.is-leaving {
    opacity: 0;
    pointer-events: none;
}

.app-loader-mark {
    position: relative;
    width: 6rem;
    height: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-loader-mark img {
    position: relative;
    z-index: 2;
    width: 4rem;
    height: 4rem;
    object-fit: contain;
}

.app-loader-progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Fades in as the spinner fades out (both toggled the moment the first progress report lands). */
.app-loader-progress.is-visible {
    opacity: 1;
}

.app-loader-track {
    fill: none;
    stroke: color-mix(in oklab, var(--primary) 22%, transparent);
    stroke-width: 4;
}

.app-loader-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 301.593;
    stroke-dashoffset: 301.593;
    transition: stroke-dashoffset 0.25s ease-out;
}

.app-loader-spinner {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 4px solid color-mix(in oklab, var(--primary) 22%, transparent);
    border-top-color: var(--primary);
    animation: app-loader-spin 1.1s infinite;
    opacity: 1;
    transition: opacity 0.4s ease;
    z-index: 1;
}

/* Keeps spinning while it fades. Stopping the animation would snap it back to 0deg mid-fade. */
.app-loader-spinner.is-hidden {
    opacity: 0;
}

.app-loader-text {
    color: var(--muted-foreground);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    animation: app-loader-pulse 2.4s ease-in-out 5s infinite;
}

@keyframes app-loader-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
/* Physics-style angular velocity instead of a constant linear spin: slowest at the top, accelerating
   as the highlight falls down one side and decelerating as it climbs the other, for a pendulum feel.
   The bezier pair matches slopes at the seams (~1.8 across the bottom, ~0.6 across the top wrap) so
   velocity is continuous, and crucially the top slope is nonzero. It eases through 12 o'clock rather
   than dead-stopping there. */
@keyframes app-loader-spin {
    0%   { transform: rotate(0deg);   animation-timing-function: cubic-bezier(0.3, 0.18, 0.7, 0.46); }
    50%  { transform: rotate(180deg); animation-timing-function: cubic-bezier(0.3, 0.54, 0.7, 0.82); }
    100% { transform: rotate(360deg); }
}

/* Honor reduced-motion: drop the spin, pulse, and crossfades. The ring still fills (stroke-dashoffset
   updates instantly) and the splash still removes on completion, just without animation. */
@media (prefers-reduced-motion: reduce) {
    .app-loader,
    .app-loader-progress,
    .app-loader-fill,
    .app-loader-spinner {
        transition: none;
    }

    .app-loader-spinner,
    .app-loader-text {
        animation: none;
    }
}

/* College Search Ribbon */
.ribbon-container {
    background: var(--card);
    overflow: hidden;
}

.ribbon-content {
    display: flex;
    align-items: stretch;
    padding: 0.75rem 1rem;
    gap: 0.375rem;
    overflow-x: auto;
    min-height: 4.5rem;
}

.ribbon-group {
    display: flex;
    flex-direction: column;
    min-width: fit-content;
}

.ribbon-group-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center controls over their centered captions; icon-only groups otherwise hug left. */
    align-items: center;
}

.ribbon-group-label {
    font-size: 0.6875rem;
    color: var(--muted-foreground);
    text-align: center;
    padding-top: 0.375rem;
    border-top: 1px solid var(--border);
    margin-top: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: nowrap;
}

.ribbon-state-field { min-width: 11rem; }
.ribbon-dropdown { min-width: 9rem; }
.ribbon-dropdown-sm { min-width: 6rem; }
.ribbon-dropdown-wide { min-width: 12rem; }
.ribbon-zip-field { width: 5.5rem; }
.ribbon-distance-field { width: 5rem; }
.ribbon-num-sm { width: 6.5rem; }
.ribbon-score-field { width: 5rem; }
.ribbon-act-field { width: 4rem; }
.ribbon-cip-field { min-width: 16rem; }

/* The ribbon keeps one row at every width. On a phone the row scrolls sideways, the same
   as on a narrow desktop window, so the groups never stack. */
.ribbon-content {
    flex-wrap: nowrap;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

/* Brand gradient emblem for working-surface page headers (Caseload, Caseload report).
   Lives here rather than in a scoped .razor.css because both pages need the identical mark and
   scoped stylesheets cannot share one. It was previously defined twice, byte-for-byte, as
   .caseload-emblem and .reports-emblem. */
.brand-emblem {
    background: linear-gradient(120deg, var(--color-brand-teal), var(--color-brand-darkblue) 85%);
}

/* Tinted badge: consumes --badge-tint set inline from data (e.g. category.Color hex) */
.badge-tinted {
    background-color: var(--badge-tint);
}

/* Service-brand avatars used on admin health cards. Brand-mandated colors,
   not part of the theme palette. */
.service-avatar-azure { background-color: #0078D4; }

.cf-stream-video,
.content-body iframe[src*="cloudflarestream.com"],
.tiptap-editor-host iframe[src*="cloudflarestream.com"] {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 8px;
    margin: 1.5rem 0;
    background: #000;
}

/* Upgrade banner for free-tier users.
   Sits directly below the fixed top header (h-16 = 4rem). */
.upgrade-banner {
    position: sticky;
    top: 4rem;
    left: 0;
    right: 0;
    z-index: 40;
    background-color: var(--primary);
    color: var(--primary-foreground);
    min-height: 2.5rem;
}

/* Site footer */
.site-footer {
    background-color: var(--muted);
    color: var(--muted-foreground);
    border-top: 1px solid var(--border);
}

.site-footer .footer-top-row {
    display: grid;
    grid-template-columns: max-content repeat(4, minmax(max-content, 1fr));
    gap: 1.5rem;
    align-items: start;
    overflow-x: auto;
}

/* Mobile: logo on its own row, link groups in a 2x2 grid instead of a horizontal scroll. */
@media (max-width: 767px) {
    .site-footer .footer-top-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow-x: visible;
    }

    .site-footer .footer-top-row > :first-child {
        grid-column: 1 / -1;
    }
}

.site-footer .footer-heading {
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.site-footer .footer-link {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer .footer-link:hover {
    color: var(--foreground);
}

.site-footer .footer-copyright,
.site-footer .footer-hidden-link,
.site-footer .footer-social-icon {
    color: var(--muted-foreground);
    transition: color 0.2s ease;
}

.site-footer .footer-hidden-link:hover,
.site-footer .footer-social-icon:hover {
    color: var(--foreground);
}

.site-footer .footer-bottom-divider {
    border-color: var(--border);
}

/* Blazor unhandled-error UI - styled as modal overlay */
#blazor-error-ui {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
}

#blazor-error-ui[style*="display: block"],
#blazor-error-ui[style*="display:block"] {
    display: flex !important;
}

#blazor-error-ui .blazor-error-dialog {
    background-color: var(--card);
    color: var(--foreground);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 25rem;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border);
}

#blazor-error-ui p {
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}
.guided-toast-provider {
    bottom: calc(1rem + var(--guided-bottom-inset, 0rem)) !important;
    transition: bottom 0.2s ease;
}
