@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #0b1120;
    --bg-2: #121a2a;
    --text: #f8fafc;
    --muted: #b3becc;
    --card: rgba(20, 28, 44, 0.9);
    --border: rgba(148, 163, 184, 0.18);
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    --accent: #1d6fd6;
    --accent-2: #3aa6ff;
    --chip-bg: rgba(148, 163, 184, 0.12);
    --chip-text: #cbd5f5;
    --status-bg: rgba(46, 160, 67, 0.2);
    --status-border: rgba(46, 160, 67, 0.4);
    --status-text: #6ee7b7;
    --announce-bg: linear-gradient(90deg, rgba(51, 39, 22, 0.95), rgba(77, 53, 24, 0.9));
    --announce-border: rgba(255, 214, 143, 0.18);
    --announce-text: #f8fafc;
    --announce-icon: #f8fafc;
    --announce-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    --toggle-bg: rgba(148, 163, 184, 0.12);
    --toggle-border: rgba(148, 163, 184, 0.3);
}

body.theme-light {
    --bg: #f5f0e9;
    --bg-2: #faf7f2;
    --text: #1f2937;
    --muted: #6b7280;
    --card: #ffffff;
    --border: #e6e2dc;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    --accent: #1d6fd6;
    --accent-2: #3aa6ff;
    --chip-bg: #eef2f7;
    --chip-text: #4b5563;
    --status-bg: #e7f7ee;
    --status-border: #b6e2c7;
    --status-text: #1f7a48;
    --announce-bg: linear-gradient(90deg, #f5d7a4, #f0c178);
    --announce-border: rgba(180, 125, 50, 0.25);
    --announce-text: #3a2b18;
    --announce-icon: #3a2b18;
    --announce-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    --toggle-bg: #f3f4f6;
    --toggle-border: #d9d4ce;
}

body.theme-glass {
    --bg: #f4ddc8;
    --bg-2: #f6e6d6;
    --text: #3a2f25;
    --muted: #6e6359;
    --card: rgba(255, 255, 255, 0.45);
    --border: rgba(255, 255, 255, 0.65);
    --shadow: 0 20px 35px rgba(120, 85, 55, 0.2);
    --chip-bg: rgba(255, 255, 255, 0.5);
    --chip-text: #5a4b40;
    --status-bg: rgba(46, 160, 67, 0.18);
    --status-border: rgba(46, 160, 67, 0.35);
    --status-text: #2f7a4c;
    --announce-bg: linear-gradient(90deg, rgba(255, 244, 229, 0.7), rgba(255, 224, 194, 0.6));
    --announce-border: rgba(255, 255, 255, 0.5);
    --announce-text: #3b2d20;
    --announce-icon: #3b2d20;
    --announce-shadow: 0 10px 22px rgba(120, 85, 55, 0.12);
    --toggle-bg: rgba(255, 255, 255, 0.5);
    --toggle-border: rgba(255, 255, 255, 0.75);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text);
    background:
        radial-gradient(600px 200px at 50% 0%, #1d283d 0%, transparent 70%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    min-height: 100vh;
}

body.theme-light {
    background:
        radial-gradient(600px 400px at 15% 10%, #f9ecd8 0%, transparent 55%),
        radial-gradient(600px 400px at 85% 0%, #eaf2fb 0%, transparent 55%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
}

body.theme-glass {
    background:
        radial-gradient(900px 480px at 12% 0%, rgba(228, 184, 41, 0.35), transparent 70%),
        radial-gradient(900px 520px at 100% 20%, rgba(217, 72, 15, 0.35), transparent 70%),
        linear-gradient(135deg, #e4b829 0%, #f27121 45%, #d9480f 100%);
}

.glass-scatter {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow: hidden;
}

.theme-glass .glass-scatter { opacity: 1; }

.glass-box {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid rgba(255, 255, 255, 0.53);
}

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(100, 120, 255, 0.35) 0%,
        rgba(100, 120, 255, 0.2) 35%,
        transparent 70%
    );
    filter: blur(30px);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.theme-glass .cursor-glow {
    background: radial-gradient(
        circle at center,
        rgba(255, 236, 214, 0.5) 0%,
        rgba(255, 236, 214, 0.22) 35%,
        transparent 70%
    );
}

a {
    color: inherit;
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 54px 24px 28px;
    gap: 26px;
    position: relative;
    z-index: 1;
}

.login-topbar {
    width: min(1040px, 100%);
    display: flex;
    justify-content: flex-end;
}

.theme-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
}

.datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--muted);
    text-align: right;
}

.datetime-time {
    font-weight: 600;
}

.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    position: relative;
    width: 84px;
    height: 28px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--toggle-border);
    background: var(--toggle-bg);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: var(--text);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.4);
    outline-offset: 2px;
}

.theme-icon {
    display: grid;
    place-items: center;
    color: var(--muted);
    z-index: 2;
}

.theme-icon i {
    font-size: 12px;
    line-height: 1;
}

.theme-indicator {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
    transition: transform 0.25s ease;
}

body[data-theme="light"] .theme-indicator { transform: translateX(0); }
body[data-theme="glass"] .theme-indicator { transform: translateX(26px); }
body[data-theme="dark"] .theme-indicator { transform: translateX(52px); }

body[data-theme="light"] .theme-icon[data-theme-icon="light"] { color: #f59e0b; }
body[data-theme="glass"] .theme-icon[data-theme-icon="glass"] { color: #0ea5e9; }
body[data-theme="dark"] .theme-icon[data-theme-icon="dark"] { color: #facc15; }

.login-grid {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.announcement-bar {
    width: min(1040px, 100%);
    background: var(--announce-bg);
    border-radius: 12px;
    border: 1px solid var(--announce-border);
    box-shadow: var(--announce-shadow);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.announcement-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    color: var(--announce-icon);
    flex-shrink: 0;
}

.announcement-icon svg {
    width: 18px;
    height: 18px;
}

.announcement-marquee {
    overflow: hidden;
    flex: 1;
}

.announcement-track {
    display: inline-flex;
    align-items: center;
    gap: 48px;
    white-space: nowrap;
    animation: marquee 22s linear infinite;
}

.announcement-text {
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--announce-text);
}

.announcement-text strong {
    font-weight: 700;
}

.info-card,
.login-card {
    border-radius: 26px;
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.info-card {
    background: linear-gradient(160deg, #ffffff 0%, #f7ead4 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body:not(.theme-light):not(.theme-glass) .info-card {
    background: linear-gradient(160deg, rgba(19, 25, 38, 0.95) 0%, rgba(25, 35, 52, 0.9) 100%);
}

body.theme-glass .info-card,
body.theme-glass .login-card {
    background: rgba(250, 253, 255, 0.16);
    border: 1px solid rgba(250, 253, 255, 0.28);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(6.3px);
    -webkit-backdrop-filter: blur(6.3px);
}

.brand-logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
}

.info-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    margin: 0;
}

.info-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
}

.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.info-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    background: #f5f8ff url("/assets/img/bg-card.png") center/cover no-repeat;
    min-height: 320px;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.55), rgba(240, 247, 255, 0.9));
    z-index: 0;
}

body.theme-glass .login-card::before {
    opacity: 0;
}

body:not(.theme-light):not(.theme-glass) .login-card {
    background: linear-gradient(rgba(11, 17, 32, 0.88), rgba(11, 17, 32, 0.88)),
        url("/assets/img/bg-card.png") center/cover no-repeat;
}

body:not(.theme-light):not(.theme-glass) .login-card::before {
    background: none;
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.login-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--status-bg);
    border: 1px solid var(--status-border);
    color: var(--status-text);
}

.login-desc {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.login-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
}

.btn-sso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: min(360px, 100%);
    padding: 14px 22px;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 14px 24px rgba(29, 111, 214, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-sso:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(29, 111, 214, 0.35);
}

.login-note {
    font-size: 12px;
    color: var(--muted);
    margin: auto 0 0;
    text-align: left;
}

.login-footer {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .announcement-track {
        animation: none;
    }
}

@media (max-width: 900px) {
    .login-grid {
        grid-template-columns: 1fr;
    }

    .login-card,
    .info-card {
        padding: 28px;
    }

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

    .announcement-bar {
        padding: 8px 12px;
    }
}

@media (max-width: 640px) {
    .login-page {
        padding: 40px 18px 20px;
    }

    .login-actions {
        justify-content: stretch;
    }

    .btn-sso {
        width: 100%;
    }
}