@keyframes animate-in {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes animate-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes hc-recovery-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#splashscreen {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;

    opacity: 1;
    background-color: white;
    z-index: 999999;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    animation-name: animate-in;
    animation-duration: 400ms;
    animation-timing-function: cubic-bezier(0.75, 0.35, 0.35, 0.75);
    animation-iteration-count: 1;
}


#splashscreen.animate-out {
    animation-name: animate-out;
    animation-duration: 200ms;
    transform: scale(0.9);
    pointer-events: none;
    opacity: 0;
}

/* ---- Recovery / stuck-state UI ---- */
#splashscreen-recovery {
    display: none;
    box-sizing: border-box;
    max-width: 420px;
    width: calc(100% - 48px);
    margin-top: 28px;
    padding: 0 16px;

    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
    color: #2c3e50;
    text-align: center;
    line-height: 1.5;
}

#splashscreen.show-recovery #splashscreen-recovery {
    display: block;
    animation: hc-recovery-fade-in 320ms ease-out both;
}

/* When recovery is visible, never let the hide animation run on top of it. */
#splashscreen.show-recovery.animate-out {
    animation: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

#splashscreen-recovery p {
    margin: 0 0 14px;
}

#splashscreen-recovery .splashscreen-recovery-primary {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 18px;
}

#splashscreen-recovery .splashscreen-recovery-secondary,
#splashscreen-recovery .splashscreen-recovery-support {
    font-size: 13px;
    color: #6c7a89;
}

#splashscreen-recovery .splashscreen-recovery-support {
    margin-top: 14px;
    margin-bottom: 0;
}

#splashscreen-refresh-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    min-width: 160px;
    margin: 0 auto 22px;
    padding: 10px 22px;

    background-color: #2a63b2;
    color: #ffffff;
    border: 1px solid #2a63b2;
    border-radius: 4px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.2px;
    cursor: pointer;

    transition: background-color 120ms ease-out, box-shadow 120ms ease-out, transform 80ms ease-out;
}

#splashscreen-refresh-btn:hover {
    background-color: #214f8e;
    border-color: #214f8e;
    box-shadow: 0 2px 6px rgba(42, 99, 178, 0.25);
}

#splashscreen-refresh-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

#splashscreen-refresh-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 99, 178, 0.35);
}

#splashscreen-refresh-btn:disabled {
    background-color: #8aa6cf;
    border-color: #8aa6cf;
    cursor: progress;
    box-shadow: none;
}
