/* Result / error card (Components/StatusPanel.razor), inside the app shell, full screen, or inside AuthShell's card. */

.stp {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    min-height: calc(100dvh - 160px);
    padding: 40px var(--ml-content-gutter, 24px);
}

/* Full screen: brand background with soft glows, the logo in the corner */
.stp-full {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 96px 20px 48px;
    background:
        radial-gradient(55% 45% at 10% 8%, rgba(118, 61, 232, 0.1), transparent 70%),
        radial-gradient(45% 40% at 90% 95%, rgba(255, 183, 165, 0.16), transparent 70%),
        var(--app-bg-soft);
}

[data-theme="dark"] .stp-full {
    background:
        radial-gradient(55% 45% at 10% 8%, rgba(156, 116, 255, 0.14), transparent 70%),
        radial-gradient(45% 40% at 90% 95%, rgba(255, 183, 165, 0.06), transparent 70%),
        var(--app-bg);
}

.stp-logo {
    position: absolute;
    top: 28px;
    left: 32px;
    display: inline-flex;
}

.stp-logo img {
    width: auto;
    height: 34px;
}

/* Only one of the two logos is shown, for the current theme */
.stp-logo-light {
    display: block;
}

.stp-logo-dark,
[data-theme="dark"] .stp-logo-light {
    display: none;
}

[data-theme="dark"] .stp-logo-dark {
    display: block;
}

/* ---------- card ---------- */

.stp-card {
    width: 100%;
    max-width: 520px;
    padding: 44px 40px 40px;
    border: 1px solid var(--app-line);
    border-radius: 28px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-card);
}

/* Content: centred in both forms (own card, or inside AuthShell's card) */
.stp-body {
    text-align: center;
}

.stp-icon {
    --stp-color: var(--app-accent);
    --stp-soft: var(--app-accent-soft);

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 22px;
    border-radius: 24px;
    background: var(--stp-soft);
    font-size: 38px;
    color: var(--stp-color);
    animation: stp-icon-in 0.7s var(--app-ease-spring) 0.1s both;
}

/* Soft ring around the tile */
.stp-icon::after {
    content: "";
    position: absolute;
    inset: -8px;
    border: 1px solid var(--stp-soft);
    border-radius: 30px;
}

.stp-icon-success {
    --stp-color: var(--app-success);
    --stp-soft: var(--app-success-soft);
}

.stp-icon-warning {
    --stp-color: var(--app-warning);
    --stp-soft: var(--app-warning-soft);
}

.stp-icon-danger {
    --stp-color: var(--app-danger);
    --stp-soft: var(--app-danger-soft);
}

@keyframes stp-icon-in {
    from {
        opacity: 0;
        transform: scale(0.4) rotate(-20deg);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.stp-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--stp-soft);
    border-top-color: var(--stp-color);
    border-radius: 50%;
    animation: app-btn-spin 0.8s linear infinite;
}

/* Big code (404) */
.stp-code {
    margin: 0 0 6px;
    font-size: clamp(72px, 14vw, 112px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
}

.stp-title {
    margin: 0 0 10px;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--app-text-strong);
    /* Lines of a title that wraps are kept about the same length; browsers without it wrap as usual */
    text-wrap: balance;
}

.stp-text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--app-text-muted);
}

/* Only a default: :where() keeps it at the weight of a bare "p", so a page's own line inside the panel (a status line
   or notice under a form, such as /verify-otp's .vo-verifying) keeps the spacing its class gives it */
:where(.stp-text) p {
    margin: 0 0 6px;
    /* The short centred lines are kept about the same length, so no line ends with a word or two on its own (Chinese
       breaks between any two characters); browsers without it wrap as usual */
    text-wrap: balance;
}

.stp-text strong {
    color: var(--app-text-strong);
}

/* Links in the text (such as a "contact us" line) in the brand colour, in every state */
.stp-text a,
.stp-text a:hover {
    font-weight: 600;
    color: var(--app-accent);
    text-underline-offset: 3px;
}

.stp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

/* ---------- responsive ---------- */

@media (max-width: 575.98px) {
    .stp-logo {
        left: 20px;
    }

    .stp-card {
        padding: 36px 22px 28px;
        border-radius: 24px;
    }

    .stp-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stp-actions .app-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stp-icon {
        animation: none;
    }
}
