.auth-page {
    min-height: 100vh;
    margin: 0;
    background: #f4f6f8;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
}

.auth-brand {
    background:
        radial-gradient(ellipse 70% 45% at 100% 0%, rgba(247, 127, 0, 0.28), transparent 55%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 31px,
            rgba(255, 255, 255, 0.035) 31px,
            rgba(255, 255, 255, 0.035) 32px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 31px,
            rgba(255, 255, 255, 0.035) 31px,
            rgba(255, 255, 255, 0.035) 32px
        ),
        linear-gradient(165deg, #152033 0%, #1b263b 55%, #24344f 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 3rem 2.5rem;
}

.auth-brand__inner {
    max-width: 28rem;
}

.auth-brand__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-weight: 800;
    font-size: 1.15rem;
}

.auth-brand__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: #fb923c;
    font-size: 1.75rem;
}

.auth-brand__tip {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
}

.auth-brand__tip p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    line-height: 1.7;
}

.auth-brand__logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    padding: 4px;
}

.auth-brand h1 {
    color: #fff;
    font-size: clamp(1.55rem, 2.6vw, 2.1rem);
    line-height: 1.4;
    margin: 0 0 0.9rem;
}

.auth-brand p {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.85;
    margin: 0 0 1.6rem;
}

.auth-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    line-height: 1.55;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
}

.auth-points i {
    color: #f77f00;
    margin-top: 0.1rem;
    flex-shrink: 0;
    font-size: 1.1rem;
}

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

.auth-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(148, 163, 184, 0.35);
    border: 1px solid rgba(65, 90, 119, 0.08);
}

.auth-tenant {
    display: inline-block;
    margin: 0 0 0.7rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    background: rgba(247, 127, 0, 0.12);
    color: #9a4e00;
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-card h2 {
    margin: 0 0 0.4rem;
    font-size: 1.45rem;
}

.auth-sub {
    margin: 0 0 1.4rem;
    color: #415a77;
}

.auth-alert {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 0.92rem;
}

.auth-card .form-control {
    background: #f8fafc;
    border: 1px solid rgba(65, 90, 119, 0.18);
    color: #1b263b;
}

.auth-card .form-control:focus {
    outline: none;
    border-color: var(--accent-orange, #ff9f00);
    box-shadow: 0 0 0 3px rgba(255, 159, 0, 0.18);
}

.auth-card .form-control:-webkit-autofill,
.auth-card .form-control:-webkit-autofill:hover,
.auth-card .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #1b263b;
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset;
    box-shadow: 0 0 0 1000px #f8fafc inset;
    transition: background-color 99999s ease-out;
    caret-color: #1b263b;
}

.auth-input-ltr {
    direction: ltr;
    text-align: left;
}

.auth-field {
    position: relative;
}

.auth-field .form-control {
    padding-right: 46px;
}

.auth-field__icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #415a77;
    pointer-events: none;
}

.auth-password {
    position: relative;
}

.auth-password .form-control {
    padding-right: 46px;
}

.auth-password__toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #415a77;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-password__toggle:hover,
.auth-password__toggle:focus-visible {
    background: #eef2f6;
    outline: none;
}

.auth-submit {
    position: relative;
    margin-top: 0.35rem;
    min-height: 48px;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.auth-submit:hover,
.auth-submit:focus-visible {
    box-shadow: 0 12px 28px rgba(255, 159, 0, 0.3);
    transform: translateY(-1px);
}

.auth-submit__spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-submit__spinner i {
    display: inline-block;
    animation: auth-spin 0.8s linear infinite;
    font-size: 1.25rem;
}

.auth-submit:disabled {
    opacity: 0.85;
    cursor: wait;
    transform: none;
}

@keyframes auth-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 1rem 0 0;
    padding: 0;
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.6;
}

.auth-hint i {
    flex-shrink: 0;
    margin-top: 0.15rem;
    font-size: 0.95rem;
}

.auth-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-user-badge i {
    color: #64748b;
    font-size: 0.95rem;
}

.auth-otp {
    display: flex;
    direction: ltr;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.auth-otp__digit {
    width: 3rem;
    height: 3.5rem;
    padding: 0;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: inherit;
    color: #1b263b;
    background: #f8fafc;
    border: 1px solid rgba(65, 90, 119, 0.18);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    caret-color: var(--accent-orange, #ff9f00);
}

.auth-otp__digit:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.auth-otp__digit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-mode-switch {
    display: block;
    width: 100%;
    margin: 0.25rem 0 0.75rem;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-size: 0.82rem;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-mode-switch:hover,
.auth-mode-switch:focus-visible {
    color: #1b263b;
    outline: none;
}

.is-hidden {
    display: none !important;
}

.auth-logout-form {
    margin-top: 0.75rem;
    text-align: center;
}

.auth-logout-form button {
    background: none;
    border: 0;
    padding: 0;
    color: #415a77;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.auth-logout-form button:hover,
.auth-logout-form button:focus-visible {
    color: #1b263b;
    outline: none;
}

.auth-logout-form .auth-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.625rem 1rem;
    color: #64748b;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.auth-logout-form .auth-logout-btn:hover,
.auth-logout-form .auth-logout-btn:focus-visible {
    color: #1e293b;
    background: #f1f5f9;
    outline: none;
}

.error-status {
    display: block;
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #f77f00;
    margin: 0 0 1.1rem;
}

.error-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    min-height: 48px;
    width: 100%;
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 1.6rem 1.4rem 1.4rem;
        justify-content: flex-start;
    }

    .auth-brand h1 {
        font-size: 1.35rem;
        margin-bottom: 0.5rem;
    }

    .auth-brand p,
    .auth-points,
    .auth-brand__tip {
        display: none;
    }

    .auth-brand__icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.35rem;
        margin-bottom: 0.75rem;
    }

    .auth-brand__logo {
        margin-bottom: 0.8rem;
    }

    .auth-otp {
        gap: 0.35rem;
    }

    .auth-otp__digit {
        width: 2.65rem;
        height: 3.15rem;
        font-size: 1.1rem;
    }

    .auth-panel {
        padding: 1.2rem 1rem 2rem;
        align-items: flex-start;
    }
}
