:root {
    --bg-deep: #050819;
    --bg-scene: #070c26;
    --frame-border: #14214d;
    --card-bg: #09102c;
    --neon-green: #00e676;
    --neon-green-glow: rgba(0, 230, 118, 0.45);
    --input-bg: #10193a;
    --input-border: #1e2c59;
    --input-focus: #00e676;
    --text-main: #ffffff;
    --text-muted: #7c94b8;
    --text-dim: #506488;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
    height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at 50% 30%, #0b143a 0%, #050819 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-main);
    overflow-x: hidden;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.lamp-off {
    background: radial-gradient(circle at 50% 30%, #05091c 0%, #02040d 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 920px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer Scene Frame (Matching the Screenshot's border framing) */
.scene-frame {
    position: relative;
    width: 100%;
    background: var(--bg-scene);
    border: 1.5px solid var(--frame-border);
    border-radius: 28px;
    padding: 48px 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.75), inset 0 0 120px rgba(7, 12, 38, 0.5);
    transition: all 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

body.lamp-off .scene-frame {
    border-color: #0d1533;
    box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.95), inset 0 0 120px rgba(2, 4, 15, 0.8);
}

/* Left Column: Lamp Container */
.lamp-column {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lamp-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.lamp-svg {
    width: 100%;
    max-width: 330px;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.45));
}

/* Lamp Lighting Transitions */
.light-beam {
    opacity: 1;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: 160px 155px;
}

body.lamp-off .light-beam {
    opacity: 0;
    pointer-events: none;
}

.inner-aperture {
    transition: fill 0.45s ease;
}

body.lamp-off .inner-aperture {
    fill: #1a2542 !important;
}

/* Face states */
.face-awake {
    opacity: 1;
    transition: opacity 0.25s ease;
}

.face-sleeping {
    opacity: 0;
    transition: opacity 0.25s ease;
}

body.lamp-off .face-awake {
    opacity: 0;
}

body.lamp-off .face-sleeping {
    opacity: 1;
}

/* Shy eyes when typing password */
.shy-eyes {
    display: none;
}

body.shy-mode:not(.lamp-off) .face-awake {
    display: none;
}

body.shy-mode:not(.lamp-off) .shy-eyes {
    display: block;
}

/* Interactive Pull Cord */
.pull-cord-group {
    cursor: pointer;
    outline: none;
    transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: 124px 160px;
}

.pull-cord-group:hover .pull-toggle {
    filter: brightness(1.2) drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.pull-cord-group:focus-visible .pull-toggle {
    stroke: var(--neon-green);
    stroke-width: 3;
}

.pull-cord-group.pulling {
    transform: translateY(24px);
}

.cord-hint {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
    transition: opacity 0.3s ease, color 0.3s ease;
    user-select: none;
}

body.lamp-off .cord-hint {
    color: #3b4e72;
}

/* Right Column: Login Card */
.login-column {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1),
                filter 0.5s ease,
                visibility 0.5s ease;
}

.login-card {
    width: 370px;
    max-width: 100%;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px 34px 32px;
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 0 1px var(--neon-green), 0 0 25px var(--neon-green-glow), 0 0 50px rgba(0, 230, 118, 0.2);
    position: relative;
    z-index: 2;
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

/* When Lamp is OFF: Hide login panel completely */
body.lamp-off .login-column {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(26px) scale(0.92);
    filter: blur(12px);
}

/* When Lamp is ON: Show login panel with glowing neon card */
body.lamp-on .login-column {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Header inside Card */
.brand-header {
    text-align: center;
    margin-bottom: 26px;
}

.brand-pill {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.brand-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

/* Form Styles */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 14.5px;
    font-family: inherit;
    color: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: #43557a;
}

.form-input:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.2);
    background: #131d45;
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: #5c749e;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.toggle-password-btn:hover {
    color: #a0aec0;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #00e676 0%, #00c853 100%);
    color: #042f14;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 15.5px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 230, 118, 0.5);
    background: linear-gradient(135deg, #10f082 0%, #00d659 100%);
}

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

.btn-login.loading {
    opacity: 0.85;
    cursor: not-allowed;
    pointer-events: none;
}

.forgot-link-wrapper {
    text-align: center;
    margin-top: 18px;
}

.forgot-link {
    font-size: 13px;
    color: #5d759e;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
    cursor: pointer;
}

.forgot-link:hover {
    color: #00e676;
    text-decoration: underline;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 15px;
    text-align: center;
    display: none;
    animation: shake 0.4s ease;
}

.login-error.visible {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scene-frame {
        flex-direction: column;
        padding: 34px 22px;
        gap: 25px;
    }

    .lamp-svg {
        max-width: 260px;
    }

    .login-card {
        width: 100%;
        padding: 30px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}