:root {
    --bg-color: #000000;
    --accent-color: #007aff;
    --accent-glow: rgba(0, 122, 255, 0.5);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100dvh;
    height: 100vh; /* fallback */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── BACKGROUND VIDEO ── */
#bgVideo {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
}

/* Dark overlay — adjust opacity to control video brightness */
.bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: -1;
    pointer-events: none;
}


.assistant-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
}

/* ====================
   ASSISTANT MAIN (ROBOT & CONTENT)
   ==================== */
.assistant-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 2.5vh, 28px);
    /* Push content up slightly from true center — more natural */
    padding-bottom: clamp(70px, 12vh, 110px);
    padding-top: 0;
    overflow: hidden;
    min-height: 0; /* flexbox shrink fix */
}

/* NEURAL ORB 2.0 */
.neural-orb-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.neural-orb {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Orb Layer */
.orb-inner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle at center, #00d2ff 0%, #3a7bd5 50%, transparent 100%);
    box-shadow: 0 0 40px var(--accent-glow);
    filter: blur(2px);
    opacity: 0.8;
}

/* Glowing Aura */
.orb-glow {
    position: absolute;
    top: -20px; left: -20px; right: -20px; bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    filter: blur(20px);
    opacity: 0.5;
    animation: orbPulse 4s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

/* ORB STATES */
.neural-orb.idle {
    animation: orbFloat 6s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.neural-orb.listening {
    transform: scale(1.2);
}
.neural-orb.listening .orb-inner {
    background: radial-gradient(circle at center, #ff4fac 0%, #7e5bef 100%);
    box-shadow: 0 0 60px rgba(255, 79, 172, 0.6);
    animation: orbRotate 2s linear infinite;
}

@keyframes orbRotate {
    0% { transform: rotate(0deg); border-radius: 45% 55% 50% 50% / 50% 50% 45% 55%; }
    50% { transform: rotate(180deg); border-radius: 55% 45% 50% 50% / 50% 50% 55% 45%; }
    100% { transform: rotate(360deg); border-radius: 45% 55% 50% 50% / 50% 50% 45% 55%; }
}

.neural-orb.speaking {
    animation: orbVibrate 0.2s linear infinite;
}

@keyframes orbVibrate {
    0% { transform: translate(0,0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, 1px); }
    100% { transform: translate(0,0); }
}

/* CONTENT AREA */
.assistant-content {
    text-align: center;
    max-width: 580px;
    width: 90vw;
    animation: contentReveal 0.8s ease-out;
    flex-shrink: 0;
}

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

#userGreeting {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.response-text {
    font-size: 13px;
    font-weight: 300;
    line-height: 1.55;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.2px;
}

.status-pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ====================
   FOOTER (INPUT PILL)
   ==================== */
.assistant-footer {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    padding-top: 10px;
    gap: 6px;
    z-index: 100;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    backdrop-filter: blur(2px);
}

.input-pill {
    width: 100%;
    max-width: 540px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 4px 6px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.input-pill:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Controls */
.pill-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.icon-toggle {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: color 0.3s, background 0.2s;
    flex-shrink: 0;
}

.icon-toggle:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.icon-toggle input { display: none; }
.icon-toggle input:checked + i {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.icon-lang {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

/* Input wrapper fills remaining space */
.input-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

#chatForm {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
}

#userInput {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 12px 8px;
    margin: 0;
    line-height: 1.2;
    outline: none;
    display: block;
}

#userInput::placeholder {
    color: var(--text-secondary);
}

/* Action Buttons */
.pill-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#micBtn {
    color: var(--text-secondary);
}
#micBtn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }

#micBtn.listening {
    color: #ff4757;
    text-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
    background: rgba(255,71,87,0.12);
}

#sendBtn {
    background: var(--text-primary);
    color: var(--bg-color);
    width: 40px;
    height: 40px;
}

#sendBtn:hover {
    background: #ffffff;
    transform: scale(1.05);
}

/* ========================
   RESPONSIVE — MOBILE
   ======================== */
@media (max-width: 600px) {
    body { overflow-y: auto; }

    .assistant-main {
        gap: 14px;
        padding-bottom: 110px;
        padding-top: 8px;
    }

    .response-text {
        font-size: 0.85rem;
        padding: 0 16px;
        max-width: 95vw;
    }

    #userGreeting {
        font-size: 11px;
    }

    .status-pill {
        font-size: 0.65rem;
        padding: 5px 12px;
    }
}
/* ====================
   VISION (CAMERA & UPLOAD)
   ==================== */
.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Preview tray — sits above the input pill, auto-collapses when empty */
.image-preview-container {
    display: flex;
    gap: 8px;
    padding: 0 4px;
    overflow-x: auto;
    max-width: 540px;
    width: 100%;
    align-self: center;
    flex-wrap: wrap;
}

/* Only show bottom spacing when tray has content */
.image-preview-container:not(:empty) {
    padding-bottom: 8px;
}

.preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    animation: previewBounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}

@keyframes previewBounce {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 2px; right: 2px;
    width: 18px; height: 18px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

/* PDF chip — overrides .preview-item constraints */
.pdf-chip {
    width: auto !important;
    height: auto !important;
    min-width: 0;
    max-width: 200px;
    overflow: visible !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px;
    background: rgba(255, 107, 107, 0.15) !important;
    border: 1px solid rgba(255, 107, 107, 0.40) !important;
}

.pdf-chip-name {
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
    display: block;
}

.icon-toggle-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.icon-toggle-btn:hover { color: var(--text-primary); }

/* CAMERA MODAL */
.camera-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.camera-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.camera-ui {
    position: absolute;
    bottom: 40px;
    left: 0; right: 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.camera-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.camera-btn.snap {
    width: 80px;
    height: 80px;
    background: #fff;
    color: #000;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.camera-btn:active { transform: scale(0.9); }

@media (max-width: 600px) {
    .camera-container { max-width: 100%; max-height: 100%; border-radius: 0; }
    #cameraVideo { border-radius: 0; }
}
/* ====================
   NEURAL DASHBOARD
   ==================== */
.dashboard-trigger {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.dashboard-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.dashboard-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(40px);
    border-left: 1px solid var(--glass-border);
    z-index: 2000;
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px;
    overflow-y: auto;
    color: var(--text-primary);
}

.dashboard-panel.active {
    right: 0;
}

.db-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.db-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #fff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.db-header button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.db-header button:hover { color: var(--text-primary); }

.db-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Delete All — red danger button */
.db-delete-all {
    background: rgba(255, 80, 80, 0.10) !important;
    border: 1px solid rgba(255, 80, 80, 0.25) !important;
    border-radius: 8px !important;
    color: rgba(255, 100, 100, 0.80) !important;
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.db-delete-all:hover {
    background: rgba(255, 80, 80, 0.25) !important;
    color: #ff6060 !important;
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.30);
}

.db-section {
    margin-bottom: 25px;
}

.db-section label {
    display: block;
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.db-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.db-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.db-item.active-filter {
    background: rgba(22, 160, 133, 0.2); /* Subtle accent tint */
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(22, 160, 133, 0.3);
}

.db-item .meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.db-memories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.memory-chip {
    font-size: 11px;
    padding: 8px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-color);
    position: relative;
}

/* Dashboard Deletion Styling */
.db-item {
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6; /* High initial visibility */
    transition: all 0.2s ease;
    z-index: 9999 !important; /* Supreme priority */
    pointer-events: auto !important; /* Punch through overlays */
}

.delete-btn:hover {
    background: #e74c3c !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    transform: scale(1.1);
}

.memory-chip .delete-btn {
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 10px;
}

/* Custom Scrollbar */
.dashboard-panel::-webkit-scrollbar {
    width: 4px;
}
.dashboard-panel::-webkit-scrollbar-track {
    background: transparent;
}
.dashboard-panel::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE
   ============================================================ */

/* ── Tablets & large phones (≤768px) ── */
@media (max-width: 768px) {
    .dashboard-panel {
        width: 100vw;
        right: -100vw;
    }
    .dashboard-panel.active { right: 0; }

    .assistant-content { max-width: 90vw; }

    .input-pill { max-width: 100%; gap: 6px; }

    .pill-controls { gap: 8px; padding-left: 4px; }

    #userInput { font-size: 0.95rem; }
}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
    .dashboard-trigger {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .assistant-footer {
        padding-left: 10px;
        padding-right: 10px;
    }

    .input-pill {
        padding: 5px 8px;
        gap: 5px;
        border-radius: 32px;
    }

    .pill-controls { gap: 6px; padding-left: 2px; }

    .icon-toggle  { font-size: 0.95rem; }
    .icon-lang    { font-size: 0.7rem; }

    #userInput { font-size: 0.9rem; padding: 8px 0; }

    /* Make action buttons touch-safe (min 44×44px) */
    .action-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .response-text {
        font-size: 0.82rem;
        line-height: 1.55;
    }

    #userGreeting { font-size: 10px; margin-bottom: 8px; }

    .status-pill {
        font-size: 0.6rem;
        padding: 4px 10px;
        letter-spacing: 1.5px;
    }
}

/* ── Very small phones (≤380px) ── */
@media (max-width: 380px) {
    /* Hide camera & lang buttons to save space */
    #cameraBtn { display: none; }
    .icon-lang  { display: none; }

    .pill-controls { gap: 5px; }

    .input-pill { padding: 4px 8px; }

    .response-text { font-size: 0.78rem; }
}

/* ── Landscape phone (short height) ── */
@media (max-height: 500px) and (orientation: landscape) {
    .assistant-main {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 20px;
        padding-bottom: 80px;
        padding-top: 4px;
    }

    .assistant-content {
        text-align: left;
        max-width: 46vw;
    }

    .assistant-footer {
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }
}

/* ── Camera modal on mobile ── */
@media (max-width: 600px) {
    .camera-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    #cameraVideo { border-radius: 0; }

    .camera-btn       { width: 52px; height: 52px; }
    .camera-btn.snap  { width: 68px; height: 68px; }
}

/* ── Image preview on mobile ── */
@media (max-width: 480px) {
    .preview-item { width: 48px; height: 48px; }
}

/* ============================================================
   HANDS-FREE TOGGLE — Top Left Corner
   ============================================================ */
.handsfree-toggle-wrap {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
}

.handsfree-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

/* Hide native checkbox */
.handsfree-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* The pill track */
.hf-track {
    position: relative;
    width: 52px;
    height: 28px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

/* The sliding thumb */
.hf-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease, color 0.3s ease;
}

/* Label text — hidden */
.hf-label { display: none; }

/* ── CHECKED (Active) state ── */
.handsfree-toggle input:checked + .hf-track {
    background: rgba(0, 180, 255, 0.30);
    border-color: rgba(0, 200, 255, 0.60);
    box-shadow: 0 0 14px rgba(0, 180, 255, 0.45), inset 0 0 6px rgba(0, 180, 255, 0.15);
}

.handsfree-toggle input:checked + .hf-track .hf-thumb {
    transform: translateX(24px);
    background: rgba(0, 200, 255, 0.90);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.7);
}

.handsfree-toggle input:checked ~ .hf-label {
    color: rgba(0, 220, 255, 0.95);
}

/* Hover effect */
.handsfree-toggle:hover .hf-track {
    border-color: rgba(255, 255, 255, 0.30);
}
.handsfree-toggle:hover .hf-label {
    color: rgba(255, 255, 255, 0.75);
}

/* Mobile: smaller */
@media (max-width: 480px) {
    .handsfree-toggle-wrap { top: 14px; left: 14px; }
    .hf-label { display: none; }
    .hf-track { width: 44px; height: 24px; border-radius: 12px; }
    .hf-thumb { width: 18px; height: 18px; font-size: 8px; }
    .handsfree-toggle input:checked + .hf-track .hf-thumb { transform: translateX(20px); }
}

/* ── LOGIN OVERLAY ─────────────────────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(18px);
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 122, 255, 0.08);
    animation: cardIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardIn {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent-color), #00c6ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.4);
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.pin-boxes {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 10px;
}

.pin-box {
    width: 45px;
    height: 55px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    transition: all 0.2s ease;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield; /* Firefox */
}

.pin-box::-webkit-outer-spin-button,
.pin-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-box:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.4);
    transform: translateY(-2px);
}

.login-error {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 10px;
    min-height: 18px;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(5px); }
}
.login-card.shake { animation: shake 0.4s ease; }
