/* Authentication Overlay Styles */

#auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(22, 24, 35, 0.98);
    /* Very dark overlay to hide content */
    backdrop-filter: blur(8px);
    z-index: 2147483647;
    /* Max Z-Index */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.auth-box {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 100%;
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.auth-box h2 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.5rem;
}

.auth-box p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#auth-password {
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#auth-password:focus {
    border-color: #0066cc;
}

#auth-form button {
    padding: 0.8rem;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

#auth-form button:hover {
    background-color: #0052a3;
}

.error-msg {
    color: #dc3545 !important;
    font-size: 0.9rem;
    margin-top: 1rem !important;
    min-height: 1.2em;
}

/* Shake Animation for wrong password */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Security Keypad */
.security-keypad {
    display: none;
    position: absolute;
    /* Changed from fixed to absolute for positioning relative to input */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    width: 300px;
    /* Default width, overridden by JS if needed */
    flex-direction: column;
    overflow: hidden;
}

.security-keypad.active {
    display: flex;
}

.keypad-header {
    background: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.keypad-header span {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.close-keypad {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    color: #666;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Default layout, JS might adjust */
    padding: 5px;
    background: #eef1f5;
    gap: 4px;
}

.keypad-grid .key-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
    /* Disable blue highlight on touch */
    -webkit-tap-highlight-color: transparent;
}

.keypad-grid .key-btn:hover {
    background-color: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#securityKeypad .keypad-grid .key-btn.btn-confirm {
    background-color: #00A0DC !important;
    color: white !important;
    border: none !important;
}

#securityKeypad .keypad-grid .key-btn.btn-confirm:hover {
    background-color: #0089bd !important;
}

/* Specific layout adjustments for different modes if needed can be done here or JS */
/* For 'abc' mode (3 rows), we usually need dynamic rows. 
   The JS renders buttons linearly. CSS grid flow works.
   But standard keyboard usually has uneven rows. 
   Simple grid: repeat(10, 1fr) for full keyboard?
   The provided JS simply appends buttons. 
   Let's check `keyboardLayouts` in JS. 
   abc: 3 arrays. 
   num: 1 array. 
   If JS just dumps buttons, we need CSS to handle rows or JS to structure them.
   Wait, original JS `renderKeypad` does:
   `container.innerHTML = ''; ... btn = createBtn... container.appendChild(btn);`
   It appends ALL buttons to `keypadContainer`.
   `keyboardLayouts.abc` is 2D array: [[row1], [row2], [row3]].
   BUT `renderKeypad` loop logic wasn't shown fully in my view_file output!
   Let's assume the previous JS implementation handled rows or I need to update JS.
   Looking at previous `renderKeypad` content in `js/main.js` (Step 1094):
   It didn't show the loop logic! It just showed `createBtn` helper. 
   I need to DOUBLE CHECK the loop logic in `js/main.js` to ensure 2D arrays are handled correctly.
   If not, I might need to fix JS too.
*/