/* Контейнер оверлея с эффектом размытия */
.pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050; /* Должен быть выше всех элементов сайта */
    
    /* Ключевые изменения: */
    background: rgba(255, 255, 255, 0.4); /* Светлый полупрозрачный фон */
    backdrop-filter: blur(8px);           /* Размытие фона под оверлеем (эффект матового стекла) */
    -webkit-backdrop-filter: blur(8px);   /* Префикс для Safari и старых iOS */
    
    display: none;
    justify-content: center;
    align-items: center;
    
    /* Плавное появление */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Состояние активного оверлея (когда убираем класс d-none через JS) */
.pin-overlay:not(.d-none) {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Альтернативный вариант для темной темы сайта (если нужно затемнение, а не осветление) */
/* Используйте этот background вместо белого выше, если сайт темный: */
/* background: rgba(0, 0, 0, 0.6); */

.pin-content {
    background: #ffffff; /* Фон самой карточки ввода должен быть непрозрачным */
    width: 90%;
    max-width: 360px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Тень для отделения от фона */
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    z-index: 1051; /* Карточка выше затемнения */
}

/* Анимация всплытия карточки */
.pin-overlay:not(.d-none) .pin-content {
    transform: translateY(0);
}

/* Остальные стили (клавиатура, точки) остаются без изменений */
.pin-header h3 { margin: 0 0 5px; color: #333; font-size: 22px; }
.pin-header p { margin: 0 0 8px; color: #666; font-size: 14px; }
#ql-msg { min-height: 20px; margin: 0 0 25px; text-align: center; line-height: 20px; }
.close-pin {
    position: absolute; top: 10px; right: 15px;
    background: none; border: none; font-size: 28px;
    color: #999; cursor: pointer; line-height: 1;
}
.close-pin:hover { color: #333; }

.pin-forget-device { margin-top: 20px; font-size: 12px; color: #999; text-align: center; }
.pin-forget-device a { color: #999; text-decoration: none; }
.pin-forget-device a:hover { color: #666; text-decoration: underline; }

.pin-dots { display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; }
.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: transparent;
    transition: all 0.15s ease;
}
.dot.filled {
    background: #000; /* Цвет заполненной точки (можно заменить на брендовый橙色 #ff7f00) */
    border-color: #000;
}
.dot.shake { animation: shake 0.4s; border-color: #dc3545; }

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 260px;
    margin: 0 auto;
}
.key {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
    color: #333;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s, transform 0.1s;
}
.key:active {
    background: #e9ecef;
    transform: scale(0.95);
}
.key.empty { visibility: hidden; pointer-events: none; }
.key.back {
    background: #f8f9fa;
    color: #666;
    font-size: 24px;
    font-weight: 400;
    font-family: Arial, sans-serif;
    border: none;
}
.key.back:hover { background: #f1f3f5; }
.key.back:active { background: #e9ecef; color: #333; transform: scale(0.95); }

#pin-msg {
    min-height: 20px;
    margin: 0 0 20px;
    font-size: 14px;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
    .pin-content {
        width: 95%;
        padding: 20px;
        border-radius: 12px;
    }
    .key { font-size: 20px; }
}


/* Короткая анимация заполнения точки PIN. */
.dot.filled {
    animation: pinDotPop 0.18s ease-out;
}

@keyframes pinDotPop {
    0% { transform: scale(0.65); }
    100% { transform: scale(1); }
}
