:root {
    --boot-navy-deep: #003466;
    --boot-navy: #00478A;
    --boot-cyan: #00A9E9;
    --boot-sky: #7DD3F5;
    --boot-ice: #EAF5FB;
    --boot-ink: #0B2A4A;
    --boot-safe-bottom: env(safe-area-inset-bottom, 0px);
    --boot-card: 148px;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--boot-ice);
    color: var(--boot-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
}

.boot {
    position: fixed;
    inset: 0;
    z-index: 9000;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 28px calc(28px + var(--boot-safe-bottom));
    padding-top: calc(50vh - (var(--boot-card) / 2));
    padding-top: calc(50dvh - (var(--boot-card) / 2));
    color: #FFFFFF;
    background: var(--boot-navy-deep);
    font-family: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", sans-serif;
    opacity: 1;
    visibility: visible;
    transition: opacity 320ms ease, visibility 0s linear 320ms;
}

body:has(#apt-app-ready) .boot {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(90% 60% at 80% 0%, rgba(0, 169, 233, 0.45), transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: boot-fade 1400ms ease-out 200ms both;
}

.boot__stage {
    position: relative;
    z-index: 2;
    width: min(100%, 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.boot__mark-wrap {
    position: relative;
    width: var(--boot-card);
    height: var(--boot-card);
    border-radius: 38px;
    background: #FFFFFF;
    display: grid;
    place-items: center;
    margin-bottom: 26px;
}

.boot__mark-shadow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 18px 44px rgba(0, 20, 45, 0.35);
    animation: boot-fade 1400ms ease-out 200ms both;
}

.boot__mark {
    position: relative;
    width: 128px;
    height: 128px;
    object-fit: contain;
}

.boot__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: boot-fade 700ms ease-out 150ms both;
}

.boot__wordmark {
    margin: 0;
    font-size: clamp(2.15rem, 8vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #FFFFFF;
}

.boot__tag {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.72);
}

.boot__meter {
    margin-top: 44px;
    width: min(220px, 70vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: boot-fade 700ms ease-out 300ms both;
}

.boot__meter-track {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
    position: relative;
}

.boot__meter-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--boot-sky), #FFFFFF);
    box-shadow: 0 0 16px rgba(125, 211, 245, 0.6);
    transition: width 220ms ease-out;
}

:root[style*="--blazor-load-percentage"] .boot__meter-fill {
    width: var(--blazor-load-percentage, 0%);
}

.boot__meter-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.7);
}

.boot__horizon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    padding-bottom: var(--boot-safe-bottom);
    animation: boot-fade 1400ms ease-out 200ms both;
}

.boot__skyline {
    display: block;
    width: 100%;
    height: 118px;
}

.boot__skyline path {
    fill: rgba(255, 255, 255, 0.10);
}

.boot__windows .w {
    fill: rgba(255, 255, 255, 0.35);
    animation: boot-window 2.8s ease-in-out infinite;
}

.boot__windows .w:nth-child(2) { animation-delay: 0.2s; }
.boot__windows .w:nth-child(3) { animation-delay: 0.45s; }
.boot__windows .w:nth-child(4) { animation-delay: 0.7s; }
.boot__windows .w:nth-child(5) { animation-delay: 0.15s; }
.boot__windows .w:nth-child(6) { animation-delay: 0.55s; }
.boot__windows .w:nth-child(7) { animation-delay: 0.9s; }
.boot__windows .w:nth-child(8) { animation-delay: 0.35s; }
.boot__windows .w:nth-child(9) { animation-delay: 0.8s; }
.boot__windows .w:nth-child(10) { animation-delay: 1.05s; }
.boot__windows .w:nth-child(11) { animation-delay: 0.5s; }
.boot__windows .w:nth-child(12) { animation-delay: 1.2s; }

.boot__windows .w--accent {
    fill: var(--boot-cyan);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 16px 16px 16px;
    z-index: 9999;
    background: rgba(11, 42, 74, 0.94);
    color: #F7FBFE;
    border-radius: 16px;
    padding: 16px 44px 16px 18px;
    box-shadow: 0 18px 40px rgba(0, 71, 138, 0.28);
    backdrop-filter: blur(10px);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

#blazor-error-ui .boot-error {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#blazor-error-ui .boot-error strong {
    font-size: 0.95rem;
}

#blazor-error-ui .boot-error span {
    font-size: 0.82rem;
    opacity: 0.78;
}

#blazor-error-ui .reload {
    margin-top: 8px;
    color: #7DD3F5;
    font-weight: 600;
    text-decoration: none;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 10px;
    right: 14px;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.7;
}

@keyframes boot-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes boot-window {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .boot__glow,
    .boot__mark-shadow,
    .boot__brand,
    .boot__meter,
    .boot__windows .w,
    .boot__horizon {
        animation: none !important;
        opacity: 1;
    }
}
