
/* --- CUSTOM NUMERIC KEYPAD (iOS Premium Glassmorphism) --- */
#custom-num-pad {
    position: fixed;
    bottom: 0; /* Full bottom docking */
    left: 0;
    width: 100%; /* Full width container */
    
    /* Glassmorphism Effect */
    background: rgba(15, 15, 20, 0.85) !important; 
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    
    z-index: 21000;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    
    border-radius: 20px 20px 0 0; /* Rounded top corners only */
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    border-right: none;
    border-bottom: none;
    
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    transform: translateY(120%); 
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers children (grid) */
}

.num-pad-header {
    width: 100%;
    max-width: 600px; /* Constraints header too */
    background: transparent;
    padding: 8px 16px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.num-pad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px;
    width: 85%; /* Ridotto da 92% a 85% */
    margin: 0 auto; /* Centrato */
    max-width: 550px; /* Further constraint for large screens */
}

#custom-num-pad.active {
    transform: translateY(0);
}

.num-pad-done-btn {
    color: #0A84FF;
    font-weight: 600;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
}

.num-key {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    height: 46px;
    font-size: 22px;
    color: #fff;
    font-weight: 400;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.1s, transform 0.05s;
}

.num-key:active,
.num-key.active-state {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0.96);
}

/* Tasti speciali */
.num-key[data-key="backspace"] {
    font-size: 22px;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Override Dark Mode Media Queries if they exist elsewhere or ensure consistency */
@media (prefers-color-scheme: dark) {
    #custom-num-pad {
        background: rgba(15, 15, 20, 0.65) !important;
    }
}


/* Fix per input "finto" che sembra vero */
.fake-input {
    cursor: pointer;
    user-select: none; /* Previene selezione testo nativa */
    -webkit-user-select: none;
    caret-color: transparent; /* Nasconde cursore nativo se presente */
}

.fake-input.focused {
    border-color: #007AFF !important;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3) !important;
}

/* Cursore simulato (lampeggiante) */
.fake-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #007AFF;
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
