:root{
    --font-sans:'Inter',ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
    --primary:#005AF6;
    --primary-dark:#032E8E;
    --primary-light:#1796FF;
    --primary-soft:rgba(0,90,246,.1);
    --accent-cyan:#06B6D4;
    --dash-bg:#F5F9FF;
    --text:#102A43;
    --muted:#64748B;
    --line:#D8E6F5;
    --surface:#FFFFFF;
    --input:#FFFFFF;
    --danger:#DC2626;
    --danger-soft:#FEE2E2;
    --warning:#F59E0B;
    --warning-soft:#FEF3C7;
    --success:#16A34A;
    --success-soft:#DCFCE7;
    --shadow:0 10px 30px rgba(37,99,235,.08);
    --gradient-main:linear-gradient(135deg,#2563EB 0%,#06B6D4 100%);
    --gradient-button:linear-gradient(135deg,#1796FF 0%,#005AF6 100%);
}

html[data-theme="dark"]{
    --primary-soft:rgba(23,195,255,.12);
    --accent-cyan:#17C3FF;
    --dash-bg:#031238;
    --text:#F8FAFC;
    --muted:#B8C7E6;
    --line:rgba(23,150,255,.25);
    --surface:#061537;
    --input:#0A225C;
    --danger:#FF5A6A;
    --danger-soft:rgba(255,90,106,.15);
    --warning:#FFB020;
    --warning-soft:rgba(255,176,32,.15);
    --success:#18D39E;
    --success-soft:rgba(24,211,158,.15);
    --shadow:0 10px 30px rgba(0,0,0,.35);
    --gradient-main:linear-gradient(135deg,#17C3FF 0%,#005AF6 55%,#032E8E 100%);
}

*, *::before, *::after{
    box-sizing:border-box;
    border-radius:0 !important;
}

html,body{
    margin:0;
    min-height:100%;
    font-family:var(--font-sans);
    background:var(--dash-bg);
    color:var(--text);
}

body{
    min-height:100vh;
    font-family:var(--font-sans);
    line-height:1.5;
}

.login-page{
    min-height:100vh;
    width:min(1650px, calc(100% - 12px));
    margin:0 auto;
    padding:18px 0;
    display:grid;
    grid-template-columns:500px minmax(0, 1fr);
    gap:90px;
    align-items:stretch;
}

.login-left{
    min-height:100%;
    padding:18px 0 26px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    position:relative;
    z-index:2;
}

.left-inner{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
}

.login-box{
    width:100%;
    min-height:clamp(560px, 63vh, 640px);
    background:var(--surface);
    border:1px solid var(--line);
    box-shadow:var(--shadow);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:42px 42px 40px;
}

.login-body{
    max-width:344px;
    width:100%;
    margin:0 auto;
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
    transform:none;
}

.login-brand{
    margin:0 0 24px;
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
}

.login-brand-image{
    display:block;
    width:220px;
    height:150px;
    margin:0 auto;
    object-fit:cover;
    object-position:center;
}

.welcome{
    text-align:left;
    margin:0 0 30px;
}

.welcome h1{
    margin:0 0 8px;
    font-size:18px;
    font-weight:700;
    color:var(--text);
}

.welcome p{
    margin:0;
    font-size:14px;
    color:var(--muted);
}

.form{display:grid;gap:18px}
.field{display:grid;gap:8px}

.field-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-height:20px;
    flex-wrap:wrap;
}

.field label{
    font-size:14px;
    font-weight:600;
    color:var(--text);
    text-align:left;
}

.lookup-text{
    display:none;
    align-items:center;
    justify-content:flex-end;
    gap:6px;
    margin-left:auto;
    font-size:12px;
    font-weight:600;
    color:var(--success);
    background:rgba(52,195,143,.10);
    border:1px solid rgba(52,195,143,.22);
    padding:4px 8px;
    border-radius:999px;
    line-height:1;
    white-space:nowrap;
    max-width:100%;
    transition:all .2s ease;
}

.lookup-text.show{display:inline-flex}

.input-wrap{position:relative}

.field-icon{
    position:absolute;
    left:14px;
    top:50%;
    transform:translateY(-50%);
    width:18px;
    height:18px;
    color:#7c8699;
    display:flex;
    align-items:center;
    justify-content:center;
    pointer-events:none;
}

.field-icon svg{
    width:18px;
    height:18px;
    stroke:currentColor;
    fill:none;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.input{
    width:100%;
    height:44px;
    border:1px solid var(--line);
    border-radius:4px;
    background:var(--input);
    padding:0 40px 0 42px;
    font-size:14px;
    color:#2f3647;
    outline:none;
    transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input[name="username"]{text-transform:uppercase}
.input[name="username"]::placeholder{text-transform:none}
.input[name="password"]{text-transform:none}
.input::placeholder{color:#9aa0b4}

.input:focus{
    border-color:var(--primary);
    background:var(--input);
    box-shadow:0 0 0 3px rgba(23,137,212,.12);
}

.input:invalid{
    border-color:#fd625e;
    box-shadow:0 0 0 3px rgba(244,106,106,.10);
}

.toggle-password{
    position:absolute;
    right:12px;
    top:50%;
    transform:translateY(-50%);
    border:none;
    background:transparent;
    padding:0;
    width:18px;
    height:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#495057;
    cursor:pointer;
    border-radius:6px;
    transition:color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.toggle-password svg{
    width:18px;
    height:18px;
    stroke:currentColor;
    fill:none;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.remember{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
    color:#495057;
    font-weight:500;
    margin-top:-2px;
}

.remember input{
    margin:0;
    accent-color:var(--primary);
}

.password-hint{
    margin:-6px 0 -2px;
    color:var(--muted);
    font-size:12px;
    line-height:1.45;
}

.btn-login{
    height:44px;
    border:none;
    border-radius:4px;
    background:var(--gradient-main);
    color:#fff;
    font-size:15px;
    font-weight:600;
    font-family:var(--font-sans) !important;
    letter-spacing:.3px;
    cursor:pointer;
    box-shadow:var(--shadow);
    transition:background .18s ease, transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn-login:active{transform:translateY(0) scale(.985)}
.btn-login:disabled{opacity:.75;cursor:not-allowed;transform:none;box-shadow:none}

.login-links{
    margin-top:-10px;
    text-align:center;
    line-height:1.2;
}

.login-links a{
    color:var(--primary);
    font-size:13px;
    font-weight:600;
    text-decoration:none;
}

.login-links a:hover{
    color:var(--primary-dark);
    text-decoration:underline;
}

.alert{
    border-radius:6px;
    padding:12px 14px;
    font-size:13px;
    font-weight:600;
    line-height:1.45;
}

.alert-danger{
    background:var(--danger-soft);
    color:var(--danger);
    border:1px solid color-mix(in srgb,var(--danger) 28%,transparent);
}

.alert-warning{
    background:var(--warning-soft);
    color:var(--warning);
    border:1px solid color-mix(in srgb,var(--warning) 28%,transparent);
}

.alert-success{
    background:var(--success-soft);
    color:var(--success);
    border:1px solid color-mix(in srgb,var(--success) 28%,transparent);
}

.copyright{
    text-align:center;
    font-size:14px;
    color:var(--muted);
    padding-top:18px;
}

.copyright .heart{color:var(--danger)}

.login-right{
    position:relative;
    overflow:hidden;
    min-height:100%;
    background:
        linear-gradient(rgba(29,78,216,.82), rgba(6,182,212,.72)),
        url('/assets/img/login-bg.webp') center/cover no-repeat;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:56px 72px;
}

.login-right::before{
    content:"";
    position:absolute;
    inset:0;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,.08), transparent 26%),
        radial-gradient(circle at 78% 18%, rgba(255,255,255,.05), transparent 22%),
        linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
    pointer-events:none;
}

.right-topline{
    position:absolute;
    left:0;
    right:0;
    top:0;
    height:3px;
    background:var(--gradient-main);
    opacity:.95;
}

.moon-toggle{
    position:absolute;
    top:20px;
    right:24px;
    width:22px;
    height:22px;
    opacity:.9;
    color:#fff;
}

.moon-toggle svg{
    width:100%;
    height:100%;
    stroke:currentColor;
    fill:none;
    stroke-width:1.8;
}

.shape{
    position:absolute;
    background:rgba(255,255,255,.30);
    border-radius:22px;
    backdrop-filter:blur(2px);
    animation:riseBubble 14s linear infinite;
    will-change:transform, opacity;
    opacity:.92;
}

.shape.s1{width:70px;height:70px;left:90px;bottom:-80px;--rot:18deg;animation-delay:0s;animation-duration:16s}
.shape.s2{width:86px;height:86px;left:250px;bottom:-120px;--rot:24deg;animation-delay:2.5s;animation-duration:18s}
.shape.s3{width:68px;height:68px;right:280px;bottom:-90px;--rot:16deg;animation-delay:5s;animation-duration:15s}
.shape.s4{width:94px;height:94px;right:180px;bottom:-140px;--rot:18deg;animation-delay:7.5s;animation-duration:19s}
.shape.s5{width:92px;height:92px;right:260px;bottom:-110px;--rot:14deg;animation-delay:10s;animation-duration:17s}
.shape.s6{width:54px;height:54px;left:38%;bottom:-70px;--rot:10deg;animation-delay:3.8s;animation-duration:13s}
.shape.s7{width:76px;height:76px;right:10%;bottom:-130px;--rot:22deg;animation-delay:8.8s;animation-duration:20s}

.quote-box{
    width:min(760px, 100%);
    max-width:760px;
    color:#fff;
    position:relative;
    z-index:2;
    padding:12px 0;
}

.quote-slider{
    position:relative;
    min-height:360px;
    width:100%;
}

.quote-slide{
    position:absolute;
    inset:0;
    width:100%;
    opacity:0;
    transform:translateY(18px);
    transition:opacity .5s ease, transform .5s cubic-bezier(.22,.61,.36,1);
    pointer-events:none;
    display:flex;
    flex-direction:column;
    justify-content:center;
}

.quote-slide.active{
    opacity:1;
    transform:translateY(0);
    pointer-events:auto;
}

.quote-mark{
    font-size:72px;
    line-height:1;
    color:#9dd5ec;
    font-weight:700;
    margin-bottom:10px;
    text-shadow:0 8px 24px rgba(15,23,42,.12);
}

.quote-text{
    font-size:24px;
    line-height:1.6;
    font-weight:700;
    margin:0 0 24px;
    max-width:720px;
    width:100%;
    word-break:normal;
    white-space:normal;
    letter-spacing:.01em;
    text-shadow:0 8px 22px rgba(15,23,42,.10);
}

.quote-author{
    display:flex;
    align-items:center;
    gap:16px;
    margin-bottom:6px;
    min-width:0;
}

.quote-avatar{
    width:52px;
    height:52px;
    border-radius:50%;
    background-size:cover;
    background-position:center;
    border:3px solid rgba(255,255,255,.18);
    box-shadow:0 12px 24px rgba(15,23,42,.18);
    flex:0 0 auto;
}

.quote-name{
    font-size:17px;
    font-weight:700;
    margin-bottom:4px;
}

.slider-dots{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:4px;
    padding-left:0;
}

.slider-dots button{
    width:10px;
    height:10px;
    border-radius:50%;
    background:rgba(255,255,255,.42);
    border:none;
    padding:0;
    cursor:pointer;
    transition:transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.slider-dots button.active{
    background:var(--input);
    transform:scale(1.1);
    box-shadow:0 0 0 5px rgba(255,255,255,.12);
}

.toggle-password:focus-visible,
.btn-login:focus-visible,
.login-links a:focus-visible,
.slider-dots button:focus-visible{
    outline:none;
    box-shadow:0 0 0 4px rgba(23,137,212,.14);
}

@keyframes riseBubble{
    0%{
        transform:translateY(0) translateX(0) rotate(var(--rot, 0deg));
        opacity:0;
    }
    10%{opacity:.9}
    50%{
        transform:translateY(-48vh) translateX(18px) rotate(calc(var(--rot, 0deg) + 4deg));
        opacity:.82;
    }
    100%{
        transform:translateY(-105vh) translateX(-12px) rotate(calc(var(--rot, 0deg) + 8deg));
        opacity:0;
    }
}

@media (max-width: 1400px){
    .login-page{
        width:min(1440px, calc(100% - 28px));
        grid-template-columns:470px minmax(0,1fr);
        gap:24px;
    }

    .login-left{
        padding:18px 0 24px;
    }

    .login-box{
        padding:38px 34px 36px;
    }

    .login-right{
        padding:48px 52px;
    }

    .quote-box{width:min(680px, 100%)}
    .quote-slider{min-height:330px}
    .quote-text{
        font-size:20px;
        max-width:680px;
    }
}

@media (max-width: 1180px){
    .login-page{
        width:min(1100px, calc(100% - 24px));
        grid-template-columns:430px minmax(0,1fr);
        gap:18px;
    }

    .login-left{
        padding:14px 0 22px;
    }

    .login-body{
        max-width:330px;
    }

    .login-box{
        padding:34px 28px;
        min-height:clamp(520px, 60vh, 600px);
    }

    .login-right{
        padding:40px 36px;
    }
}

@media (max-width: 1100px){
    .login-page{
        grid-template-columns:1fr;
        width:min(780px, calc(100% - 28px));
        padding:14px 0;
        gap:18px;
    }

    .login-right{
        min-height:420px;
        border-radius:10px;
        order:2;
    }

    .login-left{
        min-height:auto;
        order:1;
        padding:0 0 12px;
    }

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

@media (max-width: 768px){
    .login-page{
        width:min(100%, calc(100% - 24px));
    }

    .login-right{
        min-height:340px;
    }
}

@media (max-width: 560px){
    html,
    body{
        height:100%;
        min-height:100%;
        overflow-x:hidden;
        overflow-y:auto;
    }

    body{
        min-height:100svh;
        min-height:100dvh;
        background:linear-gradient(180deg, #f7fbff 0%, #eef4fa 100%);
    }

    .login-page{
        display:flex;
        align-items:center;
        justify-content:center;
        width:100%;
        min-height:100svh;
        min-height:100dvh;
        margin:0;
        padding:20px 16px;
        background:transparent;
        position:relative;
    }

    .login-left{
        width:min(100%, 408px);
        min-height:0;
        padding:0;
        display:block;
    }

    .login-right{
        display:none;
    }

    .left-inner{
        display:flex;
        align-items:center;
        justify-content:center;
    }

    .login-box{
        width:100%;
        min-height:0;
        padding:26px 22px 22px;
        align-items:flex-start;
        justify-content:flex-start;
        border:1px solid rgba(233,235,240,.96);
        box-shadow:0 18px 42px rgba(15,23,42,.08);
        background:rgba(255,255,255,.98);
    }

    .login-body{
        max-width:none;
        width:100%;
        transform:none;
    }

    .login-brand{
        margin:0 0 16px;
    }

    .welcome{
        margin:0 0 18px;
    }

    .welcome h1{
        margin-bottom:6px;
        font-size:19px;
    }

    .welcome p{
        font-size:14px;
        line-height:1.5;
    }

    .form{
        gap:15px;
    }

    .field{
        gap:7px;
    }

    .field-head{
        align-items:flex-start;
    }

    .field label{
        font-size:13px;
    }

    .lookup-text{
        margin-left:0;
        font-size:11px;
    }

    .input{
        height:46px;
        font-size:15px;
        padding-left:44px;
    }

    .toggle-password{
        right:14px;
    }

    .remember{
        margin-top:-2px;
        font-size:13px;
    }

    .btn-login{
        height:46px;
        font-size:16px;
    }

    .alert{
        padding:11px 12px;
        font-size:12px;
    }

    .copyright{
        position:fixed;
        left:50%;
        bottom:12px;
        transform:translateX(-50%);
        width:calc(100% - 32px);
        padding:0;
        font-size:12px;
        line-height:1.4;
        text-align:center;
    }
}

@media (min-width: 561px) and (max-height: 800px){
    .login-page{
        padding:10px 0;
        gap:18px;
    }

    .login-left{
        padding:10px 0 20px;
    }

    .login-body{
        max-width:330px;
    }

    .login-box{
        min-height:clamp(500px, 58vh, 580px);
        padding:28px 28px 26px;
    }

    .welcome{
        margin:0 0 20px;
    }

    .login-brand{
        margin:0 0 18px;
    }

    .form{
        gap:14px;
    }

    .login-right{
        padding:34px 38px;
    }

    .quote-slider{
        min-height:280px;
    }

    .quote-text{
        font-size:20px;
        line-height:1.5;
        margin-bottom:18px;
    }

    .quote-mark{
        font-size:58px;
        margin-bottom:6px;
    }

    .shape{
        opacity:.75;
    }
}

@media (max-width: 560px) and (max-height: 740px){
    .login-page{
        display:block;
        padding:14px 12px 12px;
    }

    .login-left{
        width:min(100%, 400px);
        margin:0 auto;
    }

    .left-inner{
        display:block;
    }

    .login-box{
        padding:20px 18px 18px;
    }

    .login-brand{
        margin:0 0 12px;
    }

    .welcome{
        margin:0 0 14px;
    }

    .form{
        gap:13px;
    }

    .input,
    .btn-login{
        height:44px;
    }

    .copyright{
        position:static;
        transform:none;
        width:auto;
        padding-top:12px;
        font-size:11px;
    }
}

@media (hover: hover) and (pointer: fine){
    .btn-login:hover{
        background:var(--primary-dark);
        transform:translateY(-1px);
        box-shadow:0 14px 30px rgba(23,137,212,.16);
        filter:brightness(1.05);
    }

    .slider-dots button:hover{
        background:rgba(255,255,255,.82);
    }

    .toggle-password:hover{
        color:var(--primary);
        background:rgba(23,137,212,.08);
    }
}

@media (prefers-reduced-motion: reduce){
    .lookup-text,
    .input,
    .toggle-password,
    .btn-login,
    .quote-slide,
    .slider-dots button{
        transition:none !important;
    }

    .shape{
        animation:none !important;
    }
}
