/* Shared pre-auth shell (WASM splash + LoginLayout + auth redirect) */

.login-background,
.app-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.app-loading {
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.18s ease-out;
}

.app-loading.is-done {
    opacity: 0;
    pointer-events: none;
}

.login-bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(28, 70, 101, 0.95) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 18%, rgba(241, 89, 46, 0.18) 0%, transparent 42%),
        radial-gradient(ellipse at 60% 85%, rgba(20, 50, 72, 0.7) 0%, transparent 50%),
        linear-gradient(160deg, #143248 0%, #1C4665 45%, #122f44 100%);
}

.login-bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.login-page-wrap {
    width: 100%;
    max-width: 440px;
}

.login-brand-block {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.login-brand-logo {
    width: 100%;
    max-width: 14rem;
    height: auto;
    display: block;
    object-fit: contain;
    filter: brightness(0) invert(1);
    padding: 4px 8px;
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.login-brand-subtitle {
    font-size: 0.8rem;
    margin: 0;
    color: var(--xp-orange, rgb(241 89 46));
    font-weight: 600;
    letter-spacing: 0.01em;
}

.login-brand-accent {
    display: block;
    width: 2.75rem;
    height: 3px;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: var(--xp-orange, rgb(241 89 46));
}

.login-frosted-card {
    border: none;
    border-radius: var(--xp-radius, 0.75rem);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    background: hsla(0, 0%, 100%, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-card-inner {
    padding: 2rem;
}

.login-prompt {
    font-size: 0.875rem;
    color: var(--xp-muted, hsl(215, 16%, 47%));
    text-align: center;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.login-ms-btn {
    width: 100%;
    height: 3rem;
    font-size: 15px;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid var(--xp-border, hsl(210, 20%, 88%));
    background: #fff;
    color: var(--xp-text, hsl(222, 47%, 11%));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.login-ms-btn:hover:not(:disabled) {
    background: hsl(210, 20%, 97%);
    border-color: rgba(241, 89, 46, 0.45);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.login-ms-btn:disabled {
    cursor: wait;
    opacity: 0.95;
}

.login-spinner-sm {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid hsla(222, 47%, 11%, 0.25);
    border-top-color: var(--xp-orange, rgb(241 89 46));
    border-radius: 50%;
    animation: login-spin 1s linear infinite;
}

.login-spinner-lg {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(241, 89, 46, 0.2);
    border-top-color: var(--xp-orange, rgb(241 89 46));
    border-radius: 50%;
    animation: login-spin 1s linear infinite;
}

.login-card-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 8rem;
}

.login-loading-text {
    font-size: 0.9375rem;
    color: var(--xp-muted, hsl(215, 16%, 47%));
    margin: 0;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.login-lock-icon {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-lock-icon rect,
.login-lock-icon path {
    fill: none;
}

.login-footer-copy {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0.5rem 0 0 0;
}

.login-footer-support {
    font-size: 11px;
    margin: 0.5rem 0 0 0;
    color: rgba(255, 255, 255, 0.55);
}

.login-footer-support a {
    color: var(--xp-orange, rgb(241 89 46));
    font-weight: 600;
    text-decoration: none;
}

.login-footer-support a:hover {
    text-decoration: underline;
}

.login-auth-body {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-auth-message {
    font-size: 1.05rem;
    color: var(--xp-text, hsl(222, 47%, 11%));
    margin: 0;
    font-weight: 400;
    text-align: center;
}

.login-auth-link {
    color: var(--xp-orange, rgb(241 89 46));
    font-size: 1rem;
    text-decoration: underline;
    font-weight: 600;
}

.login-auth-link:hover {
    color: rgb(220, 70, 30);
}

.login-auth-error {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #b42318;
    word-break: break-word;
    text-align: center;
}

@keyframes login-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading {
        transition: none;
    }

    .login-spinner-sm,
    .login-spinner-lg {
        animation: none;
    }
}
