/**
 * CSS para Modal de Dispositivo Confiável
 */

/* Botão de acesso ao modal */
.trusted-device-toggle {
    margin: 16px 0;
}

.trusted-device-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.trusted-device-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.trusted-device-btn:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.trusted-device-btn.configured {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #10b981;
    color: #059669;
}

.trusted-device-btn.configured:hover {
    background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
    border-color: #059669;
}

.trusted-device-btn i:first-child {
    font-size: 16px;
}

.trusted-device-btn i:last-child {
    font-size: 14px;
    opacity: 0.6;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

/* Quando o modal está oculto */
.modal-overlay[style*="display: none"] {
    display: none !important;
}

/* Quando o modal está visível */
.modal-overlay[style*="display: flex"] {
    display: flex !important;
}

/* Classe para modal aberto */
.modal-overlay.modal-open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
}

/* Modal container */
.modal-container {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Modal header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Modal body */
.modal-body {
    padding: 24px;
}

.trusted-device-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Modal footer */
.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-primary {
    padding: 8px 16px;
    background: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Responsividade */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 16px;
    }
    
    .modal-container {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 16px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .trusted-device-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .trusted-device-btn,
    .modal-close,
    .btn-secondary,
    .btn-primary {
        transition: none;
    }
}

/* Alto contraste */
.color-scheme-high-contrast .trusted-device-btn {
    background: white;
    border: 2px solid #000;
    color: #000;
}

.color-scheme-high-contrast .trusted-device-btn:hover {
    background: #000;
    color: white;
}

.color-scheme-high-contrast .modal-container {
    background: white;
    border: 2px solid #000;
}

.color-scheme-high-contrast .modal-header {
    border-bottom: 2px solid #000;
}

.color-scheme-high-contrast .modal-footer {
    border-top: 2px solid #000;
    background: white;
}