/*
 * Loading, approve, and reject screens (Figma: Loan-Apps › Loading, Yes, No).
 * Same look on the site and in the iOS web view. Status bar and home indicator
 * stay native, so they are not drawn here.
 */

.outcome-page {
    --ink: #0a1020;
    --bg: #f8f8f8;
    --accent: #318cf6;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    width: 100%;
    height: 100%;
}
html:has(body.outcome-page) {
    overflow: hidden;
    height: 100%;
}

body.outcome-page {
    display: flex;
    flex-direction: column;
}

.outcome-sheet {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.outcome-result {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    padding: calc(var(--safe-top) + 24px) 20px 24px;
    text-align: center;
}

.outcome-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: min(362px, 100%);
    text-align: center;
}

.outcome-copy img {
    display: block;
    width: 62px;
    height: 62px;
    flex: none;
}

.outcome-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.outcome-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
    text-align: center;
}

.outcome-lead {
    margin: 0;
    width: min(301px, 100%);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-align: center;
    color: rgba(10, 16, 32, 0.6);
}

.outcome-foot {
    flex: none;
    box-sizing: border-box;
    width: 100%;
    padding: 20px 20px calc(24px + var(--safe-bottom));
}

.outcome-button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-decoration: none;
    cursor: pointer;
}
.outcome-button:active { background: #256aba; }

.in-app .outcome-foot[data-app-native-exit] { display: none; }

/* Loader sits over the form while the request is in flight. Its motion is a CSS
   transform only: WebKit pauses scripts during the POST, and compositor animations keep going. */
.outcome-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.outcome-loader[hidden] { display: none; }
#waitScreen.outcome-loader { padding: 0; text-align: center; }

.outcome-loader .provider-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    width: min(362px, calc(100% - 40px));
    transform: translateY(-4.5px);
}
.provider-wait-icon {
    position: relative;
    width: 38px;
    height: 38px;
    flex: none;
    animation: outcome-spin 1s linear infinite;
}
.provider-wait-icon img {
    position: absolute;
    left: 3.82px;
    top: 3.17px;
    display: block;
}
.outcome-loader .provider-wait p {
    margin: 0;
    width: 238px;
    max-width: 100%;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-align: center;
    color: #0a1020;
}

.outcome-spin {
    animation: outcome-spin 1s linear infinite;
    transform-origin: center;
}
@keyframes outcome-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .outcome-spin,
    .provider-wait-icon { animation: none; }
}

@media (min-width: 900px) {
    html:not(.in-app):has(body.outcome-page) {
        overflow: auto;
        height: auto;
    }
    html:not(.in-app) body.outcome-page {
        display: flex;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
    }
    html:not(.in-app) body.outcome-page .site-footer { margin-top: auto; }
    html:not(.in-app) .outcome-sheet {
        display: flex;
        flex-direction: column;
        width: min(520px, calc(100% - 48px));
        margin: 64px auto;
        background: #fff;
        border-radius: 13px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, .1);
    }
    html:not(.in-app) .outcome-result {
        flex: none;
        padding: 48px 40px 0;
    }
    html:not(.in-app) .outcome-copy { width: 100%; }
    html:not(.in-app) .outcome-foot {
        width: 100%;
        padding: 28px 40px 32px;
    }
    html:not(.in-app) .outcome-button {
        width: auto;
        min-width: 220px;
        margin: 0 auto;
    }
    html:not(.in-app) header.nav { display: none; }
    html:not(.in-app) #main-content {
        max-width: 720px;
        padding-top: 40px;
    }
}
