:root {
    --p360-radius-sm: 10px;
}

/* === Background === */
body.loginbg-modern {
    --p360-purple: #7415ae;
    --p360-purple-dark: #5a0f8a;
    --p360-purple-light: #9b4fd0;
    --theme-page-background: #f4f1f8;
    --theme-brand-background: linear-gradient(160deg, #7415ae 0%, #5a0f8a 44%, #334d7a 100%);
    --theme-brand-orb-top: rgba(3, 246, 189, 0.07);
    --theme-brand-orb-bottom: rgba(0, 209, 255, 0.08);
    --theme-tab-background: #f5f3f8;
    --theme-tab-active-background: #7415ae;
    --theme-tab-active-shadow: 0 2px 8px rgba(116, 21, 174, 0.25);
    --theme-input-focus-shadow: 0 0 0 3px rgba(116, 21, 174, 0.08);
    --theme-button-background: linear-gradient(135deg, #7415ae 0%, #9252c6 100%);
    --theme-button-shadow: 0 3px 10px rgba(116, 21, 174, 0.2);
    --theme-button-shadow-hover: 0 5px 14px rgba(116, 21, 174, 0.28);
    --theme-ghost-hover-background: rgba(116, 21, 174, 0.03);
    background: var(--theme-page-background);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

body.loginbg-modern.theme-orange {
    --p360-purple: #f47735;
    --p360-purple-dark: #c95d22;
    --p360-purple-light: #f7a06f;
    --theme-page-background: #fbf5ef;
    --theme-brand-background: linear-gradient(160deg, #f47735 0%, #d86125 44%, #8b3c1a 100%);
    --theme-brand-orb-top: rgba(255, 210, 158, 0.16);
    --theme-brand-orb-bottom: rgba(255, 182, 112, 0.14);
    --theme-tab-background: #fbf2eb;
    --theme-tab-active-background: #f47735;
    --theme-tab-active-shadow: 0 2px 8px rgba(244, 119, 53, 0.24);
    --theme-input-focus-shadow: 0 0 0 3px rgba(244, 119, 53, 0.1);
    --theme-button-background: linear-gradient(135deg, #f47735 0%, #f09255 100%);
    --theme-button-shadow: 0 3px 10px rgba(214, 97, 37, 0.2);
    --theme-button-shadow-hover: 0 5px 14px rgba(214, 97, 37, 0.28);
    --theme-ghost-hover-background: rgba(244, 119, 53, 0.04);
}

/* === Main Card === */
.login-card {
    background: #fff;
    overflow: hidden;
    width: 100%;
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* =============================================
   LEFT PANEL (Branding)
   ============================================= */
.login-brand-panel {
    background: var(--theme-brand-background);
    width: 62%;
    padding: 32px 40px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: var(--theme-brand-orb-top);
    border-radius: 50%;
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 220px;
    height: 220px;
    background: var(--theme-brand-orb-bottom);
    border-radius: 50%;
}

/* --- Logo --- */
.login-brand-logo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 28px;
}

.login-brand-logo img {
    display: block;
    height: 32px;
    width: auto;
}

/* --- Content (badge + heading + description) --- */
.login-brand-content {
    position: relative;
    z-index: 1;
    margin-bottom: auto;
}

.login-brand-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.login-brand-content h2 {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
}

.login-brand-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 0;
    max-width: 420px;
}

/* --- Modules (2 per row) --- */
.login-brand-modules {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 24px 0 20px;
}

.login-brand-module {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand-module i {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

.login-brand-module strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.login-brand-module span {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.65);
}

/* --- Helpdesk (inline row) --- */
.login-helpdesk {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.login-helpdesk-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-helpdesk-item i {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.login-helpdesk-item strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1px;
}

.login-helpdesk-item span {
    display: block;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.55);
    word-break: break-word;
}

/* --- Brand Footer --- */
.login-brand-footer {
    position: relative;
    z-index: 1;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand-footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    margin: 0;
}

/* =============================================
   RIGHT PANEL (Form)
   ============================================= */
.login-form-panel {
    width: 38%;
    padding: 28px 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.login-form-header {
    margin-bottom: 20px;
}

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

.department-logo-wrap img {
    display: block;
    max-width: 220px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.login-form-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0;
    text-align: center;
}

.login-form-header .header-sub {
    font-weight: 400;
    color: #9ca3af;
    font-size: 14px;
}

/* === Tabs === */
.login-tabs {
    margin-bottom: 18px;
}

.login-tabs .nav-tabs {
    border: none;
    background: var(--theme-tab-background);
    border-radius: var(--p360-radius-sm);
    padding: 4px;
    display: flex;
}

.login-tabs .nav-tabs .nav-link {
    border: none;
    border-radius: 8px;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    padding: 9px 16px;
    letter-spacing: 0.4px;
    transition: all 0.25s ease;
    flex: 1;
    text-align: center;
    text-transform: uppercase;
}

.login-tabs .nav-tabs .nav-link:hover {
    color: var(--p360-purple);
}

.login-tabs .nav-tabs .nav-link.active {
    background: var(--theme-tab-active-background);
    color: #fff;
    box-shadow: var(--theme-tab-active-shadow);
}

/* === Form Controls === */
.login-form .form-group {
    margin-bottom: 18px;
    position: relative;
}

.login-form .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    letter-spacing: 0.2px;
}

.login-form .form-control {
    border: 1px solid #e5e7eb;
    border-radius: var(--p360-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    transition: all 0.25s ease;
    background: #fafafa;
    height: auto;
    min-height: 44px;
}

.login-form .form-control:focus {
    border-color: var(--p360-purple);
    box-shadow: var(--theme-input-focus-shadow);
    background: #fff;
    outline: none;
}

.login-form .form-control::placeholder {
    color: #b0b5be;
    font-size: 13px;
}

/* === Password toggle === */
.login-form .password-wrapper {
    position: relative;
}

.login-form .eyebtn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2;
}

.login-form .eyebtn:hover {
    color: var(--p360-purple);
}

/* === Buttons === */
.login-form .btn-login {
    background: var(--theme-button-background);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 11px 28px;
    border-radius: var(--p360-radius-sm);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    min-width: 120px;
    box-shadow: var(--theme-button-shadow);
}

.login-form .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--theme-button-shadow-hover);
}

.login-form .btn-login:active {
    transform: translateY(0);
}

.login-form .btn-signup {
    background: transparent;
    border: 1.5px solid #d1d5db;
    color: #374151;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 24px;
    border-radius: var(--p360-radius-sm);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    min-width: 120px;
}

.login-form .btn-signup:hover {
    border-color: var(--p360-purple);
    color: var(--p360-purple);
    background: var(--theme-ghost-hover-background);
}

/* === Links === */
.login-form .forgot-link {
    color: var(--p360-purple);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.login-form .forgot-link:hover {
    color: var(--p360-purple-dark);
    text-decoration: underline;
}

/* === Error messages === */
.login-form .text-danger {
    font-size: 11px;
    margin-top: 3px;
}

/* === Alert === */
.login-form .alert {
    border-radius: var(--p360-radius-sm);
    font-size: 12px;
    border: none;
    padding: 10px 14px;
}

.login-form .alert-warning {
    background: #fef3cd;
    color: #856404;
}

/* === Footer === */
.login-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f2;
}

.login-footer p {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 3px;
}

.login-footer a {
    color: var(--p360-purple);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* === Captcha === */
.login-form .captcha-wrapper {
    margin-bottom: 14px;
}

/* === Bottom copyright (outside card) === */
.login-copyright {
    display: none;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* --- Tablet landscape --- */
@media (max-width: 1024px) {
    .login-brand-panel {
        width: 50%;
        padding: 28px 24px 24px;
    }
    .login-form-panel {
        width: 50%;
        padding: 28px 24px 24px;
    }
    .login-brand-content h2 {
        font-size: 22px;
    }
    .login-brand-modules {
        grid-template-columns: 1fr;
    }
    .login-helpdesk {
        grid-template-columns: 1fr;
    }
}

/* --- Tablet portrait & small screens --- */
@media (max-width: 768px) {
    body.loginbg-modern {
        background: #fff;
        align-items: flex-start;
    }

    .login-card {
        flex-direction: column-reverse;
        min-height: 100vh;
    }

    /* Form comes first (visually on top due to column-reverse) */
    .login-form-panel {
        width: 100%;
        padding: 28px 24px 24px;
        flex: 1;
        order: 2;
    }

    .department-logo-wrap {
        justify-content: center;
        margin-bottom: 16px;
    }

    .department-logo-wrap img {
        max-width: 160px;
        max-height: 60px;
    }

    .login-form-header h3 {
        font-size: 16px;
        text-align: center;
    }

    .login-form-header .header-sub {
        display: block;
        margin-top: 2px;
    }

    .login-form .btn-login,
    .login-form .btn-signup {
        width: 100%;
        margin-bottom: 8px;
    }

    .login-footer {
        text-align: center;
    }

    /* Left panel becomes a compact bottom strip */
    .login-brand-panel {
        width: 100%;
        padding: 20px 20px 16px;
        min-height: auto;
        order: 1;
    }

    .login-brand-panel::before,
    .login-brand-panel::after {
        display: none;
    }

    .login-brand-logo {
        padding: 8px 12px;
        margin-bottom: 12px;
    }

    .login-brand-logo img {
        height: 24px;
    }

    .login-brand-content h2 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .login-brand-badge {
        font-size: 9px;
        padding: 4px 10px;
        margin-bottom: 10px;
    }

    /* Hide heavy content on mobile */
    .login-brand-content p,
    .login-brand-modules,
    .login-helpdesk {
        display: none;
    }

    .login-brand-footer {
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .login-brand-footer p {
        font-size: 10px;
    }
}

/* --- Phone screens --- */
@media (max-width: 480px) {
    .login-form-panel {
        padding: 24px 18px 18px;
    }

    .department-logo-wrap img {
        max-width: 140px;
        max-height: 52px;
    }

    .login-form-header h3 {
        font-size: 15px;
    }

    .login-tabs .nav-tabs .nav-link {
        font-size: 11px;
        padding: 8px 10px;
    }

    .login-form .form-control {
        min-height: 42px;
        font-size: 13px;
    }

    .login-brand-panel {
        padding: 16px 18px 12px;
    }

    .login-brand-content h2 {
        font-size: 14px;
    }

    .login-brand-logo img {
        height: 20px;
    }
}
