/**
 * Стили для PIN-кода и биометрической аутентификации
 */

/* Overlay */
.pin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal */
.pin-modal {
    background: #fff;
    border-radius: 24px;
    padding: 32px 24px 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

/* Header */
.pin-header {
    text-align: center;
    margin-bottom: 32px;
}

.pin-title {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.pin-subtitle {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* PIN Dots */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 2px solid #d1d5db;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: linear-gradient(135deg, #006b3e, #008a4f);
    border-color: #006b3e;
    transform: scale(1.1);
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.pin-dots.shake {
    animation: shake 0.4s ease;
}

/* Error message */
.pin-error {
    text-align: center;
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    min-height: 20px;
}

/* Keyboard */
.pin-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pin-key {
    aspect-ratio: 1;
    border: none;
    background: #f3f4f6;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-key:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

.pin-key-empty {
    background: transparent;
    cursor: default;
}

.pin-key-empty:active {
    transform: none;
}

.pin-key-delete {
    background: #fee2e2;
    color: #dc2626;
}

.pin-key-delete:active {
    background: #fecaca;
}

/* Footer */
.pin-footer {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.pin-link {
    background: none;
    border: none;
    color: #006b3e;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    -webkit-tap-highlight-color: transparent;
}

.pin-link:active {
    opacity: 0.7;
}

/* Biometric prompt */
.biometric-prompt {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.2s ease;
}

.biometric-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.biometric-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    text-align: center;
}

.biometric-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 32px;
}

.biometric-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.biometric-cancel:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Login screen with biometric */
.login-biometric-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #006b3e, #008a4f);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    -webkit-tap-highlight-color: transparent;
}

.login-biometric-btn:active {
    transform: scale(0.98);
}

.login-pin-btn {
    width: 100%;
    padding: 16px;
    background: #f3f4f6;
    color: #111827;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.login-pin-btn:active {
    background: #e5e7eb;
}

/* Responsive */
@media (max-width: 480px) {
    .pin-modal {
        padding: 24px 20px 20px;
    }

    .pin-title {
        font-size: 20px;
    }

    .pin-keyboard {
        gap: 10px;
    }

    .pin-key {
        font-size: 22px;
        border-radius: 12px;
    }
}

/* iOS safe-area support */
@supports (padding: max(0px)) {
    .pin-overlay {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}
