.xim-auth-body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: #1d2433;
    background: #f4f7fb;
    color-scheme: light;
}

.xim-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.xim-auth-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(155deg, var(--auth-from), var(--auth-to));
}

.xim-auth-hero-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
}

.xim-auth-hero-pattern::before,
.xim-auth-hero-pattern::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.xim-auth-hero-pattern::before {
    width: 280px;
    height: 280px;
    right: -90px;
    top: -70px;
}

.xim-auth-hero-pattern::after {
    width: 180px;
    height: 180px;
    left: -60px;
    bottom: 8%;
}

.xim-auth-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 520px;
    padding: 1.5rem 1.25rem 1.25rem;
}

.xim-auth-logo {
    display: block;
    width: auto;
    max-width: 168px;
    max-height: 52px;
    object-fit: contain;
}

.xim-auth-logo-desktop,
.xim-auth-nav-name {
    display: none;
}

.xim-auth-badge,
.xim-auth-kicker {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.xim-auth-badge {
    margin-top: 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.xim-auth-hero h1 {
    margin: 0;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.xim-auth-hero-copy {
    display: none;
    margin: 1rem 0 0;
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    line-height: 1.6;
}

.xim-auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 2rem;
}

.xim-auth-card {
    width: 100%;
    max-width: 440px;
}

.xim-auth-kicker {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.xim-auth-card h2 {
    margin: 0 0 0.4rem;
    color: #151b2b;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.xim-auth-form-copy {
    margin: 0 0 1.5rem;
    color: #5d677a;
    line-height: 1.5;
}

.xim-auth-field {
    margin-bottom: 1rem;
}

.xim-auth-field label {
    display: block;
    margin-bottom: 0.4rem;
    color: #243049;
    font-size: 0.92rem;
    font-weight: 600;
}

.xim-auth .form-control {
    height: 48px;
    border: 1px solid #d5dce8;
    border-radius: 12px;
    background: #fff;
    color: #1d2433;
    font-size: 1rem;
    box-shadow: none;
}

.xim-auth .form-control::placeholder {
    color: #8b95a7;
}

.xim-auth .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}

.xim-auth-password {
    position: relative;
}

.xim-auth-password .form-control {
    padding-right: 4.5rem;
}

.xim-auth-reveal {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 36px;
    padding: 0 0.55rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #41506a;
    font-size: 0.82rem;
    font-weight: 600;
}

.xim-auth-reveal:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.xim-auth-note {
    display: block;
    margin-top: 0.35rem;
    color: #5d677a;
    font-size: 0.82rem;
}

.xim-auth-note.is-success {
    color: #0f766e;
}

.xim-auth .form-control[readonly] {
    background: #f4f7fb;
    color: #41506a;
}

.xim-auth-resend {
    margin: 0.85rem 0 0;
}

.xim-auth-resend button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
}

.xim-auth-resend button:disabled {
    color: #8b95a7;
    cursor: not-allowed;
}

.xim-auth-error {
    display: block;
    margin-top: 0.35rem;
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 500;
}

.xim-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.25rem 0 1.15rem;
}

.xim-auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #314056;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
}

.xim-auth-remember input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary);
}

.xim-auth-text-link {
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.xim-auth-text-link:hover {
    color: var(--auth-to);
    text-decoration: underline;
}

.xim-auth-submit {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.xim-auth-submit:hover,
.xim-auth-submit:focus {
    background: var(--auth-to);
    color: #fff;
}

.xim-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.15rem 0;
    color: #7b8798;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.xim-auth-divider::before,
.xim-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e1e7f0;
}

.xim-auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 48px;
    border: 1px solid #d5dce8;
    border-radius: 12px;
    background: #fff;
    color: #1d2433;
    font-weight: 600;
    text-decoration: none;
}

.xim-auth-google:hover,
.xim-auth-google:focus {
    border-color: #b7c3d6;
    background: #f8fafc;
    color: #1d2433;
    text-decoration: none;
}

.xim-auth-switch {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid #e6ebf3;
}

.xim-auth-switch p {
    margin: 0;
    color: #5d677a;
    font-size: 0.88rem;
}

.xim-auth-role {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 48px;
    border: 1.5px solid var(--primary);
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.06);
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.xim-auth-role:hover,
.xim-auth-role:focus {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.xim-auth-role.is-soon,
.xim-auth-role.is-soon:hover,
.xim-auth-role.is-soon:focus {
    border-style: dashed;
    border-color: #c5cedb;
    background: #f7f8fb;
    color: #5d677a;
    cursor: default;
}

.xim-auth-soon {
    margin-left: 0.35rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #e7edf5;
    color: #41506a;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.xim-auth-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.55rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e6ebf3;
    color: #6d788a;
    font-size: 0.75rem;
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
}

.xim-auth-legal a {
    color: #4d596c;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.xim-auth a:focus-visible,
.xim-auth button:focus-visible,
.xim-auth input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (min-width: 992px) {
    .xim-auth {
        grid-template-columns: minmax(0, 55fr) minmax(320px, 45fr);
    }

    .xim-auth-hero {
        display: flex;
        align-items: center;
        min-height: 100vh;
        padding: 3rem 6vw;
    }

    .xim-auth-hero-inner {
        padding: 0;
    }

    .xim-auth-logo {
        max-width: 220px;
        max-height: 72px;
    }

    .xim-auth-logo-desktop {
        display: block;
    }

    .xim-auth-logo-mobile,
    .xim-auth-kicker {
        display: none;
    }

    .xim-auth-hero h1 {
        font-size: clamp(2.4rem, 4vw, 3.5rem);
    }

    .xim-auth-hero-copy {
        display: block;
    }

    .xim-auth-panel {
        min-height: 100vh;
        padding: 2.5rem 2rem;
        background: #f4f7fb;
    }

    .xim-auth-card {
        padding: 2rem 2rem 1.5rem;
        border: 1px solid #e6ebf3;
        border-radius: 24px;
        background: #fff;
        box-shadow: 0 24px 60px rgba(3, 4, 94, 0.08);
    }
}

@media (max-width: 991.98px) {
    .xim-auth-hero {
        overflow: hidden;
    }

    .xim-auth-hero-pattern {
        display: none;
    }

    .xim-auth-hero-inner {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        max-width: none;
        min-height: 64px;
        padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 1rem 0.65rem;
    }

    .xim-auth-logo-mobile {
        width: 40px;
        height: 40px;
        max-width: 40px;
        max-height: 40px;
        margin: 0;
        flex: 0 0 auto;
        object-fit: contain;
    }

    .xim-auth-nav-name {
        display: block;
        color: #fff;
        font-size: 1.05rem;
        font-weight: 600;
        line-height: 1.2;
    }

    .xim-auth-badge,
    .xim-auth-hero h1 {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .xim-auth-panel {
        margin-top: 0;
        padding: 1.5rem 1.25rem 2.5rem;
        background: #fff;
    }

    .xim-auth-card {
        padding: 0.5rem 0.1rem 0.25rem;
        border-radius: 0;
        background: #fff;
        box-shadow: none;
    }

    .xim-auth-kicker {
        margin-bottom: 0.9rem;
    }

    .xim-auth-card h2 {
        margin-bottom: 0.55rem;
    }

    .xim-auth-form-copy {
        margin-bottom: 1.65rem;
    }

    .xim-auth-field {
        margin-bottom: 1.15rem;
    }

    .xim-auth-row {
        align-items: flex-start;
        flex-wrap: wrap;
        margin-bottom: 1.25rem;
    }

    .xim-auth-divider {
        margin: 1.4rem 0;
    }

    .xim-auth-switch {
        gap: 0.85rem;
        margin-top: 1.75rem;
        padding-top: 1.4rem;
    }

    .xim-auth-legal {
        gap: 0.55rem 0.85rem;
        margin-top: 1.5rem;
        padding-top: 1.15rem;
        line-height: 1.45;
    }
}

.xim-public-notices {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
}

.xim-public-notices h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.xim-public-notices ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xim-public-notices li + li {
    margin-top: 0.85rem;
}

.xim-public-notices a {
    font-weight: 600;
}

.xim-public-notices span,
.xim-public-notices li {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
    .xim-auth *,
    .xim-auth *::before,
    .xim-auth *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
