* {
    box-sizing: border-box;
}

:root {
    --primary: #1677ff;
    --primary-dark: #0b4fc7;
    --accent: #2de2c4;
    --white: #ffffff;
    --text: #1d2433;
    --soft-text: #5e6b82;
    --border-soft: rgba(255,255,255,0.22);
    --glass: rgba(255,255,255,0.10);
    --danger: #ff6876;
    --success: #2bb673;
    --shadow: 0 20px 50px rgba(0,0,0,0.22);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f3f6fb;
    color: var(--text);
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
}

.login-page {
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    background: #000;
}

/* AFTER DOOR OPEN -> show login-bg1.jpg */
.login-bg {
    position: fixed;
    inset: 0;
    background: url('../images/login-bg1.jpg') center center / cover no-repeat;
    filter: brightness(0.84) saturate(1.02);
    transform: scale(1.01);
    z-index: 0;
}

.login-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(7, 20, 40, 0.34), rgba(20, 40, 75, 0.18)),
        radial-gradient(circle at 20% 20%, rgba(45, 226, 196, 0.06), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(22, 119, 255, 0.08), transparent 34%);
    z-index: 1;
}

.login-shell {
    position: relative;
    z-index: 2;
    min-height: calc(100vh - 54px);
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(380px, 450px);
    gap: 26px;
    align-items: center;
    padding: 26px 34px 82px;
}

.login-left-zone {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80%;
    gap: 15px;
}

.login-feature-panel,
.email-reference-box,
.glass-card,
.help-chat-box,
.simple-card,
.support-thread-list,
.support-chat-main {
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.17);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

/* TOP LEFT BOX - REDUCED */
.login-feature-panel {
    padding: 20px 24px;
    border-radius: 22px;
    color: var(--white);
    max-width: 980px;
    min-height: auto;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    margin-top: 8px;
}

.login-feature-panel h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.18;
    font-weight: 800;
}

/* EMAIL BOX - REDUCED HEIGHT */
.email-reference-box {
    border-radius: 22px;
    overflow: hidden;
    color: var(--white);
    max-width: 760px;
}

.email-reference-head {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    font-weight: 700;
    font-size: 15px;
}

.email-reference-head small {
    color: rgba(255,255,255,0.82);
    font-size: 12px;
}

.email-reference-list {
    max-height: 205px;
    overflow: auto;
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

.email-reference-list::-webkit-scrollbar {
    width: 8px;
}

.email-reference-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
}

.email-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.10);
    font-size: 13px;
    line-height: 1.35;
    color: #fff;
}

.login-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 0 10px 10px;
}

/* RIGHT LOGIN BOX - REDUCED */
.glass-card {
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    padding: 26px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
    pointer-events: none;
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.brand-badge {
    display: inline-block;
    padding: 9px 16px;
    background: rgba(255,255,255,0.16);
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 14px;
    font-size: 13px;
}

.animated-login-title {
    margin: 0 0 10px;
    font-size: 31px;
    line-height: 1.12;
    font-weight: 900;
    text-transform: uppercase;
}

.animated-login-title span {
    display: block;
    animation: glowText 3s ease-in-out infinite;
}

.animated-login-title span:last-child {
    animation-delay: .4s;
}

@keyframes glowText {
    0%   { transform: translateY(0); text-shadow: 0 0 0 rgba(255,255,255,0.2); }
    50%  { transform: translateY(-2px); text-shadow: 0 0 16px rgba(255,255,255,0.45); }
    100% { transform: translateY(0); text-shadow: 0 0 0 rgba(255,255,255,0.2); }
}

.login-subtitle,
.simple-subtitle {
    margin: 0 0 18px;
    color: rgba(255,255,255,0.92);
    font-size: 15px;
    line-height: 1.45;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
}

.form-control,
.help-chat-form input,
.support-admin-form input {
    width: 100%;
    border: 1px solid #d6dce8;
    background: rgba(255,255,255,0.93);
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 15px;
    outline: none;
    transition: .25s ease;
    min-height: 50px;
}

.form-control:focus,
.help-chat-form input:focus,
.support-admin-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13,110,253,0.14);
}

.password-wrap {
    position: relative;
}

.show-pass-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    padding: 10px 13px;
    cursor: pointer;
    font-weight: 700;
    min-width: 72px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: 800;
    transition: all 0.25s ease;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), #1d8cff);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.login-submit-btn {
    position: relative;
    min-height: 54px;
    margin-top: 4px;
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin .9s linear infinite;
}

.is-loading .btn-loader {
    display: inline-block;
}

.is-loading .btn-text {
    opacity: .88;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    border-radius: 14px;
    padding: 12px 15px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 700;
}

.alert-danger {
    background: rgba(255, 82, 82, 0.18);
    border: 1px solid rgba(255, 82, 82, 0.35);
    color: #fff;
}

.alert-success {
    background: rgba(30, 180, 100, 0.18);
    border: 1px solid rgba(30, 180, 100, 0.35);
    color: #fff;
}

.login-form-links,
.simple-bottom-links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin: 4px 0 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.88);
    flex-wrap: wrap;
}

.login-form-links a,
.simple-bottom-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.login-form-links a:hover,
.simple-bottom-links a:hover {
    text-decoration: underline;
}

.login-footer-text {
    margin-top: 14px;
    text-align: center;
    color: rgba(255,255,255,0.95);
    font-size: 14px;
}

/* BOTTOM RIBBON */
.bottom-ribbon {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    height: 46px;
    display: grid;
    grid-template-columns: 120px 1fr;
    background: rgba(5, 15, 37, 0.88);
    border-top: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
}

.ribbon-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(90deg, rgba(22,119,255,0.88), rgba(45,226,196,0.45));
    font-size: 15px;
}

.ribbon-track {
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ribbon-move {
    display: inline-flex;
    white-space: nowrap;
    gap: 52px;
    color: #fff;
    font-weight: 600;
    padding-left: 100%;

    /* 🔥 VERY SLOW PREMIUM SCROLL */
    animation: marqueeMove 270s linear infinite;

    font-size: 14px;
}

.ribbon-move span::before {
    content: '•';
    margin-right: 12px;
    color: var(--accent);
}

@keyframes marqueeMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* SUPPORT CHAT BUTTON */
.help-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 58px;
    z-index: 30;
}

.help-chat-toggle {
    border: none;
    background: linear-gradient(90deg, var(--primary), #1d8cff);
    color: #fff;
    padding: 13px 18px;
    border-radius: 999px;
    font-weight: 800;
    box-shadow: 0 16px 35px rgba(11, 52, 133, 0.28);
    cursor: pointer;
    font-size: 14px;
}

.help-chat-box {
    width: 360px;
    border-radius: 22px;
    overflow: hidden;
    color: #fff;
    margin-top: 12px;
    display: none;
}

.chat-open .help-chat-box {
    display: block;
}

.help-chat-head,
.support-chat-headline,
.support-admin-head {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.help-chat-head small,
.support-chat-headline p,
.support-admin-head p {
    display: block;
    color: rgba(255,255,255,0.76);
    margin-top: 3px;
}

.help-chat-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.14);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.help-chat-body,
.support-admin-messages {
    height: 320px;
    overflow: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-empty-state,
.support-thread-empty {
    color: rgba(255,255,255,0.78);
    text-align: center;
    padding: 22px 12px;
    font-size: 14px;
}

.chat-msg {
    max-width: 88%;
}

.chat-msg.user {
    align-self: flex-end;
    text-align: right;
}

.chat-msg.admin {
    align-self: flex-start;
}

.chat-msg-label {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
    color: rgba(255,255,255,0.78);
}

.chat-msg-sub {
    font-size: 11px;
    margin-bottom: 4px;
    color: rgba(255,255,255,0.64);
}

.chat-msg-bubble {
    padding: 11px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    background: rgba(255,255,255,0.14);
    color: #fff;
    display: inline-block;
    text-align: left;
}

.chat-msg.user .chat-msg-bubble {
    background: linear-gradient(90deg, rgba(22,119,255,0.85), rgba(29,140,255,0.92));
}

.chat-msg-time {
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.66);
}

.help-chat-form,
.support-admin-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px 16px 10px;
    border-top: 1px solid rgba(255,255,255,0.10);
}

.help-chat-note {
    padding: 0 16px 14px;
    color: rgba(255,255,255,0.74);
    font-size: 12px;
}

/* DOOR INTRO */
.door-intro {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow: hidden;
    background-image: url('../images/login-bg.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 1;
    visibility: visible;
    transition: opacity .8s ease, visibility .8s ease;
}

.door-intro::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

.door-half {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-image: url('../images/login-bg.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    transition: transform 5.2s ease-in-out;
    box-shadow: none;
}

.left-door {
    left: 0;
    background-position: left center;
}

.right-door {
    right: 0;
    background-position: right center;
}

.door-center-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    text-align: center;
    padding: 20px;
    text-shadow: 0 8px 25px rgba(0,0,0,0.35);
    z-index: 2;
    animation: fadePulse 2.3s infinite;
}

@keyframes fadePulse {
    0% { opacity: .6; }
    50% { opacity: 1; }
    100% { opacity: .6; }
}

.door-intro.open .left-door {
    transform: translateX(-100%);
}

.door-intro.open .right-door {
    transform: translateX(100%);
}

.door-intro.hide-intro {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp .9s ease forwards;
}

.delay-1 { animation-delay: .2s; }
.delay-2 { animation-delay: .45s; }
.delay-3 { animation-delay: .7s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.simple-screen .login-shell {
    display: none;
}

.simple-card-wrap {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.simple-card {
    width: 100%;
    max-width: 520px;
    border-radius: 26px;
    padding: 30px;
    color: #fff;
}

.simple-title {
    margin: 0 0 10px;
    font-size: 32px;
    color: #fff;
}

.support-admin-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(45, 226, 196, 0.22), transparent 24%),
        linear-gradient(135deg, #071326, #11386d);
    color: #fff;
}

.support-admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    padding: 24px;
}

.support-thread-list,
.support-chat-main {
    border-radius: 22px;
    overflow: hidden;
}

.support-thread-list {
    display: flex;
    flex-direction: column;
}

#adminThreadList {
    padding: 14px;
    overflow: auto;
}

.support-thread-item {
    width: 100%;
    text-align: left;
    display: block;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
}

.support-thread-item strong,
.support-thread-item span,
.support-thread-item small {
    display: block;
}

.support-thread-item span,
.support-thread-item small {
    color: rgba(255,255,255,0.74);
    margin-top: 4px;
}

.support-thread-item.active {
    background: linear-gradient(135deg, rgba(22,119,255,0.68), rgba(45,226,196,0.28));
    border-color: rgba(255,255,255,0.16);
}

.support-chat-headline h2,
.support-admin-head h1 {
    margin: 0;
}

.support-chat-headline p,
.support-admin-head p {
    margin: 6px 0 0;
}

.app-header-center {
    overflow: hidden;
    width: 100%;
}

.scroll-wrapper {
    overflow: hidden;
    width: 100%;
}

.scroll-track {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

.ptpl-summary-card {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 150px;
    margin: 10px;
    background-color: #f0f0f0;
    font-weight: bold;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.diff-negative {
    animation: blinkRed 1s infinite;
    color: #a71d2a;
    background-color: #f8d7da;
}

.diff-positive {
    animation: pulseGreen 1s infinite;
    color: #155724;
    background-color: #d4edda;
}

@keyframes blinkRed {
    0%, 100% { background-color: #f8d7da; color: #a71d2a; }
    50% { background-color: #ff4d4d; color: #fff; }
}

@keyframes pulseGreen {
    0%, 100% { background-color: #d4edda; color: #155724; }
    50% { background-color: #28a745; color: #fff; }
}

@media (max-width: 1180px) {
    .login-shell {
        grid-template-columns: 1fr;
        padding-bottom: 110px;
    }

    .login-left-zone {
        order: 2;
    }

    .login-wrapper {
        order: 1;
        justify-content: center;
        min-height: auto;
    }

    .login-feature-panel,
    .email-reference-box {
        max-width: 100%;
    }
}

@media (max-width: 1100px) {
    .content-area {
        padding-right: 22px;
    }

    .notice-corner {
        position: static;
        width: auto;
        margin: 0 22px 22px;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 900px) {
    .login-highlights {
        grid-template-columns: 1fr;
    }

    .support-admin-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-shell {
        padding: 16px 16px 108px;
        gap: 16px;
    }

    .login-feature-panel h2,
    .animated-login-title,
    .simple-title {
        font-size: 24px;
    }

    .glass-card,
    .simple-card,
    .login-feature-panel {
        padding: 20px;
    }

    .help-chat-panel {
        right: 12px;
        left: 12px;
        bottom: 56px;
    }

    .help-chat-box {
        width: 100%;
    }

    .help-chat-form,
    .support-admin-form,
    .login-form-links,
    .simple-bottom-links,
    .bottom-ribbon {
        grid-template-columns: 1fr;
        display: grid;
    }

    .bottom-ribbon {
        height: auto;
    }

    .ribbon-label {
        min-height: 40px;
    }

    .door-center-text {
        font-size: 24px;
    }

    .login-wrapper {
        justify-content: center;
        padding: 0;
    }

    .glass-card {
        max-width: 100%;
    }

    .topbar {
        height: auto;
        padding: 12px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-group,
    .filter-actions {
        width: 100%;
    }
}