/* POS UMKM - Modern Login Screen (Light/Base) */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #f8fafc;
    overflow-x: hidden;
    position: relative;
    perspective: 1500px;
    isolation: isolate;
}

.login-page::before {
    content: '';
    position: fixed;
    inset: -20%;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, #000 0%, transparent 70%);
    animation: loginGridDrift 18s linear infinite;
}

.login-shell {
    width: min(1100px, 100%) !important;
    min-height: 580px !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10;
    animation: loginShellReveal 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loginShellReveal {
    from { opacity: 0; transform: translateY(18px) scale(0.985); filter: blur(8px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes loginGridDrift {
    to { transform: translate3d(42px, 42px, 0); }
}

/* LEFT COLUMN - INTRO */
.login-intro {
    position: relative;
    padding: 60px 50px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff !important;
    background: linear-gradient(135deg, #020617, #0f172a, #064e3b);
    background-size: 300% 300%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    z-index: 0;
}

.bg-shape.shape-1 {
    width: 300px;
    height: 300px;
    background: #1e3a8a;
    top: -50px;
    left: -50px;
    animation: float1 10s infinite alternate;
}

.bg-shape.shape-2 {
    width: 400px;
    height: 400px;
    background: #064e3b;
    bottom: -100px;
    right: -100px;
    animation: float2 12s infinite alternate;
}

.bg-shape.shape-3 {
    width: 200px;
    height: 200px;
    background: #4c1d95;
    top: 40%;
    left: 20%;
    animation: float3 8s infinite alternate;
}

@keyframes float1 { 0% { transform: translate(0, 0); } 100% { transform: translate(30px, 40px); } }
@keyframes float2 { 0% { transform: translate(0, 0); } 100% { transform: translate(-40px, -30px); } }
@keyframes float3 { 0% { transform: translate(0, 0); } 100% { transform: translate(20px, -20px); } }

.intro-content {
    position: relative;
    z-index: 2;
}

.intro-content > * {
    animation: loginContentRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-content > :nth-child(1) { animation-delay: 0.08s; }
.intro-content > :nth-child(2) { animation-delay: 0.15s; }
.intro-content > :nth-child(3) { animation-delay: 0.22s; }
.intro-content > :nth-child(4) { animation-delay: 0.29s; }

@keyframes loginContentRise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-brand-image-wrap {
    margin-bottom: 40px;
}

.login-brand-logo {
    max-width: 180px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    animation: loginBrandBreathe 4.8s ease-in-out 1s infinite;
}

@keyframes loginBrandBreathe {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); }
    50% { transform: translateY(-3px); filter: drop-shadow(0 12px 18px rgba(37,99,235,0.28)); }
}

.login-intro h1 {
    font-size: clamp(32px, 4vw, 44px) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    margin-bottom: 20px !important;
    letter-spacing: -1px !important;
    color: #fff !important;
}

.login-intro p {
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff !important;
    margin-bottom: 40px !important;
    font-weight: 400;
}

.login-motto {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
    font-style: italic;
}

.motto-line {
    width: 40px;
    height: 2px;
    background: #10b981;
    display: inline-block;
}

/* RIGHT COLUMN - PANEL */
.login-panel {
    padding: 60px 50px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    animation: loginPanelReveal 0.72s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loginPanelReveal {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: translateX(0); }
}

.glass-panel {
    width: 100%;
    max-width: 400px;
}

.glass-panel h2 {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.glass-panel .subtitle {
    color: #64748b;
    margin-bottom: 35px;
    font-size: 15px;
}

.modern-input-group {
    position: relative;
    margin-bottom: 24px;
}

.modern-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.modern-input {
    width: 100%;
    height: 52px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 12px;
    padding: 0 16px;
    font-size: 15px;
    color: #0f172a;
    transition: all 0.3s ease;
    outline: none;
}

.modern-input:focus {
    background: #fff;
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #2563eb;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 0 0 12px 12px;
}

.modern-input:focus + .focus-border {
    width: 100%;
}

.btn-glow {
    width: 100%;
    height: 52px;
    margin-top: 10px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.login-footer-note {
    margin-top: 30px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

/* Fast success transition: scan, confirm, then hand off to the workspace. */
.login-success-transition {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    background:
        radial-gradient(circle at center, rgba(37, 99, 235, 0.28), transparent 34%),
        linear-gradient(145deg, rgba(2, 6, 23, 0.97), rgba(15, 23, 42, 0.98));
    transition: opacity 0.24s ease, visibility 0s linear 0.24s;
}

.login-success-core {
    display: grid;
    justify-items: center;
    gap: 7px;
    color: #fff;
    opacity: 0;
    transform: translateY(12px) scale(0.94);
}

.login-success-core > strong {
    margin-top: 14px;
    font-size: 22px;
    letter-spacing: -0.3px;
}

.login-success-core > span {
    color: #a9bdd9;
    font-size: 14px;
}

.login-success-mark {
    position: relative;
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    border-radius: 30px;
    overflow: visible;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(96, 165, 250, 0.48);
    box-shadow: 0 24px 80px rgba(37, 99, 235, 0.35);
}

.login-success-mark img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.login-success-ring {
    position: absolute;
    inset: -1px;
    border: 1px solid rgba(96, 165, 250, 0.78);
    border-radius: 32px;
    opacity: 0;
}

.login-success-scan {
    position: absolute;
    z-index: 3;
    left: 14px;
    right: 14px;
    height: 2px;
    top: 16px;
    opacity: 0;
    background: linear-gradient(90deg, transparent, #93c5fd 25%, #fff 50%, #93c5fd 75%, transparent);
    box-shadow: 0 0 14px #60a5fa;
}

.login-success-check {
    position: absolute;
    z-index: 4;
    right: -7px;
    bottom: -7px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff !important;
    font-size: 17px !important;
    font-weight: 900;
    background: #10b981;
    border: 3px solid #0f172a;
    opacity: 0;
    transform: scale(0.4);
}

.login-auth-success .login-shell,
.login-auth-success .login-theme-toggle {
    animation: loginWorkspaceHandoff 0.52s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

.login-auth-success .login-success-transition {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.login-auth-success .login-success-core {
    animation: loginSuccessCore 0.42s 0.08s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-auth-success .ring-one { animation: loginSuccessRing 0.72s 0.08s ease-out forwards; }
.login-auth-success .ring-two { animation: loginSuccessRing 0.72s 0.22s ease-out forwards; }
.login-auth-success .login-success-scan { animation: loginSuccessScan 0.5s 0.06s ease-in-out forwards; }
.login-auth-success .login-success-check { animation: loginSuccessCheck 0.28s 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes loginWorkspaceHandoff {
    to { opacity: 0; transform: scale(1.025); filter: blur(8px); }
}

@keyframes loginSuccessCore {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes loginSuccessRing {
    0% { opacity: 0.85; transform: scale(0.94); }
    100% { opacity: 0; transform: scale(1.65); border-radius: 46px; }
}

@keyframes loginSuccessScan {
    0% { opacity: 0; transform: translateY(0); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(70px); }
}

@keyframes loginSuccessCheck {
    to { opacity: 1; transform: scale(1); }
}

/* RESPONSIVE (MOBILE) */
@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .login-intro {
        min-height: 210px !important;
        padding: 30px 36px !important;
    }
    
    .login-intro h1 {
        font-size: 28px !important;
        margin-bottom: 12px !important;
    }
    
    .login-intro p {
        margin-bottom: 20px !important;
    }

    .login-panel {
        padding: 32px 36px !important;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 10px;
    }

    .login-shell {
        min-height: 0 !important;
        border-radius: 18px !important;
    }

    .login-intro {
        min-height: 108px !important;
        padding: 22px 20px !important;
    }

    .login-brand-image-wrap { margin: 0; }
    .login-brand-logo { max-width: 136px; }
    .login-intro h1,
    .login-intro p,
    .login-motto { display: none; }
    
    .login-panel {
        padding: 26px 20px !important;
    }

    .glass-panel h2 {
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page::before,
    .login-shell,
    .login-panel,
    .intro-content > *,
    .login-brand-logo,
    .bg-shape,
    .login-success-core,
    .login-success-ring,
    .login-success-scan,
    .login-success-check,
    .login-auth-success .login-shell,
    .login-auth-success .login-theme-toggle {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .login-auth-success .login-success-core,
    .login-auth-success .login-success-check {
        opacity: 1;
        transform: none;
    }
}
