:root {
    --login-bg: #f4f5fb;
    --login-surface: rgba(255, 255, 255, 0.88);
    --login-surface-strong: #ffffff;
    --login-border: rgba(106, 92, 188, 0.12);
    --login-text: #312f5c;
    --login-muted: #6f7392;
    --login-accent: #6A5CBC;
    --login-accent-strong: #5647a9;
    --login-accent-soft: #D3E0E0;
    --login-shadow: 0 28px 80px rgba(86, 71, 169, 0.16);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Sora", "Segoe UI", sans-serif;
    color: var(--login-text);
    background:
        radial-gradient(circle at top left, rgba(106, 92, 188, 0.18), transparent 32%),
        radial-gradient(circle at right 20%, rgba(211, 224, 224, 0.6), transparent 24%),
        linear-gradient(135deg, #f8f9fe 0%, #f3f5fb 48%, #eef2f7 100%);
}

.login-shell {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 32px 20px;
    display: grid;
    place-items: center;
}

.login-shell::before,
.login-shell::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(6px);
    opacity: 0.9;
    pointer-events: none;
}

.login-shell::before {
    width: 320px;
    height: 320px;
    top: -100px;
    left: -110px;
    background: linear-gradient(135deg, rgba(106, 92, 188, 0.20), rgba(106, 92, 188, 0));
}

.login-shell::after {
    width: 260px;
    height: 260px;
    right: -80px;
    bottom: -70px;
    background: linear-gradient(135deg, rgba(211, 224, 224, 0.7), rgba(211, 224, 224, 0));
}

.login-layout {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 24px;
    align-items: stretch;
}

.login-brand,
.login-card {
    backdrop-filter: blur(18px);
    border: 1px solid var(--login-border);
    border-radius: 32px;
    box-shadow: var(--login-shadow);
}

.login-brand {
    padding: 44px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(211, 224, 224, 0.92)),
        linear-gradient(135deg, #ffffff, #eef3f7);
    color: var(--login-text);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 560px;
}

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-brand-mark {
    width: min(100%, 80px);
    background: transparent;
    border: 0;
    display: block;
}

.login-brand-mark img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.login-brand h1 {
    margin: 0;
    max-width: 10ch;
    font-size: clamp(2.3rem, 4vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
}

.login-brand-copy {
    max-width: 560px;
}

.login-brand-copy p {
    margin: 18px 0 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--login-muted);
}

.login-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.login-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(106, 92, 188, 0.08);
    border: 1px solid rgba(106, 92, 188, 0.12);
    font-size: 0.88rem;
    color: var(--login-accent-strong);
}

.login-card {
    padding: 32px;
    background: var(--login-surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card-inner {
    width: min(100%, 420px);
    margin: 0 auto;
}

.login-card-head {
    margin-bottom: 24px;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--login-accent-soft);
    color: var(--login-accent-strong);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-card h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.6rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.login-card p {
    margin: 14px 0 0;
    color: var(--login-muted);
    line-height: 1.7;
}

.login-alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(166, 45, 45, 0.18);
    background: rgba(214, 79, 79, 0.08);
    color: #7e2020;
    font-size: 0.94rem;
}

.login-meta {
    margin: 24px 0 28px;
}

.login-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(106, 92, 188, 0.08);
}

.login-meta-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--login-accent-soft);
    color: var(--login-accent-strong);
    display: grid;
    place-items: center;
}

.login-meta-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.login-meta-copy {
    display: block;
    margin-top: 4px;
    color: var(--login-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.login-button {
    width: 100%;
    border: 0;
    border-radius: 22px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--login-accent) 0%, var(--login-accent-strong) 100%);
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
    box-shadow: 0 18px 35px rgba(86, 71, 169, 0.24);
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 42px rgba(86, 71, 169, 0.28);
}

.login-button[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.82;
}

.microsoft-badge {
    width: 24px;
    height: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    flex: 0 0 24px;
}

.microsoft-badge span:nth-child(1) {
    background: #f25022;
}

.microsoft-badge span:nth-child(2) {
    background: #7fba00;
}

.microsoft-badge span:nth-child(3) {
    background: #00a4ef;
}

.microsoft-badge span:nth-child(4) {
    background: #ffb900;
}

.button-content,
.button-loading {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.button-loading[hidden] {
    display: none;
}

.login-footnote {
    margin-top: 16px;
    color: var(--login-muted);
    font-size: 0.84rem;
    line-height: 1.6;
    text-align: center;
    max-width: 34ch;
    margin-left: auto;
    margin-right: auto;
}

.login-footnote strong {
    color: var(--login-text);
}

.login-corporate {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(106, 92, 188, 0.12);
    text-align: center;
}

.login-corporate span {
    display: block;
    margin-bottom: 10px;
    color: var(--login-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-corporate img {
    width: min(100%, 240px);
    height: auto;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: auto;
    }

}

@media (max-width: 640px) {
    .login-shell {
        padding: 16px;
    }

    .login-brand,
    .login-card {
        border-radius: 26px;
    }

    .login-brand,
    .login-card {
        padding: 24px;
    }

    .login-brand-top {
        align-items: flex-start;
    }

    .login-brand h1 {
        max-width: none;
        font-size: 2.3rem;
    }

    .login-meta-item {
        padding: 12px 14px;
    }
}