:root {
    --auth-text: #1e1830;
    --auth-muted: #736b86;
    --auth-panel-shadow: 0 26px 70px rgba(35, 12, 60, 0.16);
    --auth-card-radius: 0;
    --auth-input-radius: 16px;
}

body.loginbg.auth-modern-page {
    --p360-purple: #7415ae;
    --p360-purple-dark: #4d0c78;
    --p360-purple-soft: #9b4fd0;
    --auth-border: rgba(116, 21, 174, 0.14);
    --theme-page-background:
        radial-gradient(circle at top left, rgba(116, 21, 174, 0.14), transparent 30%),
        radial-gradient(circle at right center, rgba(3, 159, 247, 0.1), transparent 26%),
        linear-gradient(135deg, #f6f3fb 0%, #ece6f7 36%, #e6effa 100%);
    --theme-page-orb-top: linear-gradient(135deg, rgba(116, 21, 174, 0.14), rgba(0, 209, 255, 0.08));
    --theme-page-orb-bottom: linear-gradient(135deg, rgba(3, 159, 247, 0.14), rgba(116, 21, 174, 0.08));
    --theme-brand-background:
        radial-gradient(circle at top right, rgba(3, 246, 189, 0.1), transparent 24%),
        radial-gradient(circle at bottom left, rgba(0, 209, 255, 0.08), transparent 28%),
        linear-gradient(160deg, #7415ae 0%, #5a0f8a 48%, #2e467a 100%);
    --theme-brand-orb-top: linear-gradient(135deg, rgba(3, 159, 247, 0.16), rgba(3, 246, 189, 0.06));
    --theme-brand-orb-bottom: linear-gradient(135deg, rgba(0, 209, 255, 0.14), rgba(143, 0, 255, 0.04));
    --theme-content-background:
        linear-gradient(180deg, rgba(248, 246, 252, 0.9) 0%, rgba(255, 255, 255, 1) 16%),
        #fff;
    --theme-input-background: linear-gradient(180deg, rgba(247, 244, 251, 0.95), rgba(255, 255, 255, 1));
    --theme-input-focus-border: rgba(116, 21, 174, 0.45);
    --theme-input-focus-shadow: 0 0 0 4px rgba(116, 21, 174, 0.08);
    --theme-button-primary: linear-gradient(135deg, #7415ae 0%, #8e43c4 100%);
    --theme-button-primary-shadow: 0 14px 24px rgba(116, 21, 174, 0.18);
    --theme-button-secondary: linear-gradient(135deg, #039ff7 0%, #38b9f6 100%);
    --theme-button-secondary-shadow: 0 14px 24px rgba(3, 159, 247, 0.16);
    --theme-neutral-border: rgba(116, 21, 174, 0.18);
    --theme-section-border: rgba(116, 21, 174, 0.1);
    --theme-note-background: linear-gradient(135deg, rgba(116, 21, 174, 0.06), rgba(3, 159, 247, 0.08));
    --theme-resource-background: linear-gradient(180deg, rgba(247, 244, 251, 0.92), rgba(255, 255, 255, 1));
    --theme-resource-border: rgba(116, 21, 174, 0.09);
    --theme-error-icon-background: rgba(116, 21, 174, 0.08);
    --theme-error-code: rgba(116, 21, 174, 0.28);
    --theme-error-tip-border: rgba(116, 21, 174, 0.08);
    --theme-debug-background: linear-gradient(180deg, rgba(247, 244, 251, 0.95), rgba(255, 255, 255, 1));
    --theme-debug-border: rgba(116, 21, 174, 0.1);
    --theme-helper-background: rgba(116, 21, 174, 0.06);
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--theme-page-background);
    position: relative;
    overflow-x: hidden;
}

body.loginbg.auth-modern-page.theme-orange {
    --p360-purple: #f47735;
    --p360-purple-dark: #c95d22;
    --p360-purple-soft: #f7a06f;
    --auth-border: rgba(244, 119, 53, 0.16);
    --theme-page-background:
        radial-gradient(circle at top left, rgba(244, 119, 53, 0.12), transparent 30%),
        radial-gradient(circle at right center, rgba(255, 176, 102, 0.08), transparent 26%),
        linear-gradient(135deg, #fcf6f1 0%, #f8ede4 36%, #fff7ef 100%);
    --theme-page-orb-top: linear-gradient(135deg, rgba(244, 119, 53, 0.14), rgba(255, 193, 122, 0.08));
    --theme-page-orb-bottom: linear-gradient(135deg, rgba(255, 170, 102, 0.14), rgba(244, 119, 53, 0.08));
    --theme-brand-background:
        radial-gradient(circle at top right, rgba(255, 206, 145, 0.12), transparent 24%),
        radial-gradient(circle at bottom left, rgba(255, 229, 186, 0.08), transparent 28%),
        linear-gradient(160deg, #f47735 0%, #d86125 48%, #8b3c1a 100%);
    --theme-brand-orb-top: linear-gradient(135deg, rgba(255, 206, 145, 0.18), rgba(255, 255, 255, 0.04));
    --theme-brand-orb-bottom: linear-gradient(135deg, rgba(255, 177, 89, 0.16), rgba(255, 255, 255, 0.03));
    --theme-content-background:
        linear-gradient(180deg, rgba(255, 248, 242, 0.92) 0%, rgba(255, 255, 255, 1) 16%),
        #fff;
    --theme-input-background: linear-gradient(180deg, rgba(255, 248, 243, 0.95), rgba(255, 255, 255, 1));
    --theme-input-focus-border: rgba(244, 119, 53, 0.45);
    --theme-input-focus-shadow: 0 0 0 4px rgba(244, 119, 53, 0.1);
    --theme-button-primary: linear-gradient(135deg, #f47735 0%, #f09255 100%);
    --theme-button-primary-shadow: 0 14px 24px rgba(214, 97, 37, 0.2);
    --theme-button-secondary: linear-gradient(135deg, #c95d22 0%, #f08f53 100%);
    --theme-button-secondary-shadow: 0 14px 24px rgba(201, 93, 34, 0.18);
    --theme-neutral-border: rgba(244, 119, 53, 0.18);
    --theme-section-border: rgba(244, 119, 53, 0.1);
    --theme-note-background: linear-gradient(135deg, rgba(244, 119, 53, 0.07), rgba(255, 193, 122, 0.12));
    --theme-resource-background: linear-gradient(180deg, rgba(255, 248, 243, 0.92), rgba(255, 255, 255, 1));
    --theme-resource-border: rgba(244, 119, 53, 0.09);
    --theme-error-icon-background: rgba(244, 119, 53, 0.08);
    --theme-error-code: rgba(244, 119, 53, 0.28);
    --theme-error-tip-border: rgba(244, 119, 53, 0.08);
    --theme-debug-background: linear-gradient(180deg, rgba(255, 248, 243, 0.95), rgba(255, 255, 255, 1));
    --theme-debug-border: rgba(244, 119, 53, 0.1);
    --theme-helper-background: rgba(244, 119, 53, 0.06);
}

body.loginbg.auth-modern-page::before,
body.loginbg.auth-modern-page::after {
    content: '';
    position: fixed;
    inset: auto;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
}

body.loginbg.auth-modern-page::before {
    top: -120px;
    right: -120px;
    width: 360px;
    height: 360px;
    background: var(--theme-page-orb-top);
    filter: blur(18px);
}

body.loginbg.auth-modern-page::after {
    left: -150px;
    bottom: -180px;
    width: 420px;
    height: 420px;
    background: var(--theme-page-orb-bottom);
    filter: blur(22px);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0;
}

.auth-card {
    max-width: none;
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 35% 65%;
    background: rgba(255, 255, 255, 0.98);
    border: none;
    border-radius: var(--auth-card-radius);
    overflow: hidden;
    box-shadow: none;
    min-height: 100vh;
}

.auth-card.auth-card-wide {
    max-width: none;
}

.auth-brand-panel {
    position: relative;
    padding: 42px 34px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: var(--theme-brand-background);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    opacity: 0.8;
}

.auth-brand-panel::before {
    width: 240px;
    height: 240px;
    top: -80px;
    right: -60px;
    background: var(--theme-brand-orb-top);
}

.auth-brand-panel::after {
    width: 300px;
    height: 300px;
    left: -120px;
    bottom: -140px;
    background: var(--theme-brand-orb-bottom);
}

.auth-brand-stack,
.auth-brand-meta {
    position: relative;
    z-index: 1;
}

.auth-brand-logo {
    width: fit-content;
    max-width: 100%;
    padding: 16px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 34px rgba(29, 7, 45, 0.14);
    margin-bottom: 28px;
}

.auth-brand-logo img {
    display: block;
    width: min(100%, 260px);
    height: auto;
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.auth-brand-copy h2 {
    margin: 0 0 14px;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 700;
}

.auth-brand-copy p {
    margin: 0;
    max-width: 32ch;
    font-size: 15px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.92);
}

.auth-brand-modules {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.auth-brand-module,
.auth-helpdesk-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.auth-brand-module i,
.auth-helpdesk-item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 18px;
}

.auth-brand-module strong,
.auth-helpdesk-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.auth-brand-module span,
.auth-helpdesk-item span {
    display: block;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.84);
}

.auth-helpdesk {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.auth-brand-meta p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.auth-content-panel {
    padding: 34px 48px 30px;
    background: var(--theme-content-background);
}

.auth-department-logo {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.auth-department-logo img {
    display: block;
    max-width: 190px;
    max-height: 76px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-panel-body {
    max-width: 760px;
}

.auth-panel-body.auth-panel-body-narrow {
    max-width: 560px;
}

.auth-heading {
    margin: 0;
    color: var(--auth-text);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-subheading {
    margin: 10px 0 28px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.7;
}

.auth-form-card {
    padding: 24px 0 0;
}

.auth-form-grid {
    display: grid;
    gap: 18px;
}

.auth-form-grid.auth-form-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-modern-page .form-group {
    margin-bottom: 0;
}

.auth-modern-page label {
    display: block;
    margin-bottom: 7px;
    color: #3a3150;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-modern-page .form-control {
    width: 100%;
    border: 1px solid var(--auth-border);
    background: var(--theme-input-background);
    border-radius: var(--auth-input-radius);
    min-height: 52px;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--auth-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-modern-page .form-control:focus {
    border-color: var(--theme-input-focus-border);
    box-shadow: var(--theme-input-focus-shadow);
    transform: translateY(-1px);
    outline: none;
}

.auth-modern-page .form-control::placeholder {
    color: #9a90ae;
}

.auth-modern-page .password-wrapper {
    position: relative;
}

.auth-modern-page .eyebtn {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: #7d7294;
    cursor: pointer;
    z-index: 2;
}

.auth-modern-page .eyebtn:hover {
    color: var(--p360-purple);
}

.auth-modern-page .alert {
    border-radius: 18px;
    border: none;
    box-shadow: 0 14px 28px rgba(68, 27, 101, 0.08);
}

.auth-modern-page .text-danger,
.auth-modern-page .help-block.text-danger,
.auth-modern-page .label .text-danger {
    display: block;
    margin-top: 8px;
    font-size: 12px;
}

.auth-captcha {
    padding: 4px 0 0;
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.auth-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    margin-top: 6px;
}

.btn-login,
.btn-signup,
.btn-neutral {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
}

.btn-login {
    color: #fff;
    background: var(--theme-button-primary);
    box-shadow: var(--theme-button-primary-shadow);
}

.btn-signup {
    color: #fff;
    background: var(--theme-button-secondary);
    box-shadow: var(--theme-button-secondary-shadow);
}

.btn-neutral {
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--theme-neutral-border);
}

.btn-login:hover,
.btn-signup:hover,
.btn-neutral:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-login:hover,
.btn-login:focus,
.btn-signup:hover,
.btn-signup:focus {
    color: #fff;
}

.btn-neutral:hover,
.btn-neutral:focus {
    color: var(--auth-text);
}

.auth-inline-link {
    color: var(--p360-purple);
    font-weight: 700;
    text-decoration: none;
}

.auth-inline-link:hover {
    color: var(--p360-purple-dark);
    text-decoration: none;
}

.auth-contact {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--theme-section-border);
}

.auth-contact p {
    margin: 0 0 6px;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.7;
}

.auth-copyright {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    padding: 10px 0 16px;
}

.auth-copyright strong {
    color: #fff;
}

.auth-password-note {
    margin-top: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--theme-note-background);
    color: #4b3d61;
    font-size: 13px;
    line-height: 1.7;
}

.auth-password-note strong {
    display: block;
    margin-bottom: 6px;
    color: #38274f;
}

.auth-password-note ul {
    margin: 0;
    padding-left: 18px;
}

.error-clean-page {
    min-height: 100vh;
}

.error-page-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 34px 34px;
}

.error-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.error-page-branding img {
    display: block;
    max-width: 240px;
    width: 100%;
    height: auto;
}

.error-page-department img {
    display: block;
    max-width: 180px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.error-page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 0;
}

.error-page-card {
    width: 100%;
    max-width: 760px;
    text-align: center;
    padding: 28px 30px;
}

.error-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--theme-error-icon-background);
    color: var(--p360-purple);
    font-size: 34px;
}

.error-page-code {
    margin: 22px 0 10px;
    color: var(--theme-error-code);
    font-size: 88px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.error-page-title {
    margin: 0;
    color: var(--auth-text);
    font-size: 40px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.error-page-message {
    max-width: 620px;
    margin: 16px auto 0;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.8;
}

.error-page-tips {
    display: grid;
    gap: 10px;
    max-width: 620px;
    margin: 24px auto 0;
}

.error-page-tip {
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--theme-error-tip-border);
    color: var(--auth-text);
    font-size: 14px;
    line-height: 1.6;
}

.auth-error-debug {
    display: grid;
    gap: 10px;
    max-width: 620px;
    margin: 24px auto 0;
    padding: 18px 20px;
    border-radius: 20px;
    background: var(--theme-debug-background);
    border: 1px solid var(--theme-debug-border);
}

.auth-error-debug-row {
    display: grid;
    gap: 4px;
}

.auth-error-debug-row strong {
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 700;
}

.auth-error-debug-row span {
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}

.auth-error-actions {
    margin-top: 28px;
    justify-content: center;
}

.error-page-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--theme-error-tip-border);
}

.error-page-footer p {
    margin: 0 0 6px;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.7;
}

.auth-resource-grid,
.auth-video-grid {
    display: grid;
    gap: 18px;
}

.auth-resource-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.auth-video-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 24px;
}

.auth-resource-card,
.auth-video-card {
    height: 100%;
    padding: 18px;
    border-radius: 22px;
    background: var(--theme-resource-background);
    border: 1px solid var(--theme-resource-border);
    box-shadow: 0 14px 24px rgba(48, 19, 78, 0.06);
}

.auth-resource-card h5,
.auth-video-card h5 {
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 1.45;
    color: var(--auth-text);
}

.auth-resource-card p {
    margin: 0 0 14px;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.6;
}

.auth-video-card iframe {
    width: 100%;
    height: 200px;
    border: 0;
    border-radius: 16px;
}

.auth-helper-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.auth-helper-list span {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--theme-helper-background);
    color: var(--p360-purple);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1199px) {
    .auth-card {
        grid-template-columns: 40% 60%;
    }
}

@media (max-width: 991px) {
    .auth-shell {
        padding: 0;
    }

    .auth-card,
    .auth-card.auth-card-wide {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-brand-panel {
        padding: 32px 24px 28px;
    }

    .auth-content-panel {
        padding: 24px 22px 22px;
    }

    .auth-card {
        min-height: auto;
    }

    .auth-department-logo {
        justify-content: flex-start;
    }

    .auth-heading {
        font-size: 28px;
    }

    .auth-form-grid.auth-form-grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .auth-brand-copy h2 {
        font-size: 26px;
    }

    .auth-heading {
        font-size: 24px;
    }

    .auth-content-panel,
    .auth-brand-panel {
        padding-left: 18px;
        padding-right: 18px;
    }

    .error-page-shell {
        padding: 20px 18px 24px;
    }

    .error-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .error-page-card {
        padding: 18px 0;
    }

    .error-page-code {
        font-size: 58px;
    }

    .error-page-title {
        font-size: 30px;
    }

    .btn-login,
    .btn-signup,
    .btn-neutral {
        width: 100%;
    }
}
